Ques: Advantages of use case diagram in object oriented design explain with Example?
Ans: Use Case Diagram _
Use Case diagrams show the various activities the s can perform on the system. System is something that performs a function. They model the dynamic aspects of the system. Provides a ’s perspective of the system.
Benefits of Use Cases Use cases are a mature model to capture software requirements. They are often contrasted to large, monolithic documents that attempt but fail to completely convey all possible requirements before construction of a new system begins. Use cases have a number of advantages: • Use case modeling (including the writing of use case specifications) is generally regarded as an excellent technique for capturing the functional requirements of a system. • Use cases discourage premature design. • Use cases are traceable. • Use cases can serve as the basis for the estimating, scheduling, and validating effort. • Use cases are reusable within a project. The use case can evolve at each iteration from a method of capturing requirements, to development guidelines to programmers, to a test case and finally into documentation. • Use case alternative paths capture additional behavior that can improve system robustness. • Use cases are useful for scoping. Use cases make it easy to take a staged delivery approach to projects; they can be relatively easily added and removed from a software project as priorities change. • Use cases have proved to be easily understandable by business s, and so have proven an excellent bridge between software developers and end s. • Use case specifications don't use a special language. They can be written in a variety of styles to suit the particular needs of the project. • Use cases allow us to tell stories. It is very easy to describe a use case in a concrete way by turning it into a story or scenario. • Use cases are concerned with the interactions between the and the system. They make it possible for interface designers to become involved
• • • •
• •
in the development process either before or in parallel with software developers. Use cases put requirements in context; they are clearly described in relationship to business tasks. Use case diagrams help stakeholders to understand the nature and scope of the business area or the system under development. Use case diagrams can be recorded using the UML and maintained within widely available CASE tools Use cases and use case diagrams can be fully integrated with other analysis and design deliverables created using a CASE tool to produce a complete requirements, design and implementation repository Test Cases(System, Acceptance and Functional) can be directly derived from the use cases Use cases are critical for the effective execution of Performance Engineering
Use case diagram Example of Process
Ques: During object oriented design sometime need arise to readjust the inheritance explain with example? Ans: Inheritance provides a natural classification for kinds of objects and allows for the commonality of objects to be explicitly taken advantage of in modeling and constructing object systems. Natural means we use concepts, classification, and generalization to understand and deal with the complexities of the real world. See the example below using computers
An example of the is-a-kind-of relationship is shown below. Is-a is often used synonymously, but can be used to show the "object is-a class" instantiation relationship. In classical OO, inheritance is a relationship between classes only. In one-level systems, is-a (object instantiation) and is-a-kind-of (inheritance) are merged into one.
Computer / | \ Mainframe Mini Personal / \ ... / \ Data Proc Scientific PC Workstation
Another Example: Inheritance is a technique by which the properties and attributes of a class are inherited by a subclass. With inheritance we can refine the subclasses by adding some new attributes and functionality. For Example, the Employee class shown below is the super class and the classes Salesman and s Assistant are inherited classes.
Ques: what is object-oriented modeling? Explain object model and dynamic Model? Ans: Object-oriented modeling is a methodology of analyzing requirements of a system with the aim of identifying subsystems with the following desirable properties: (a) Each subsystem should have clearly specified responsibility of performing a part of overall task. (b) Other parts of the subsystem should not have to know how a subsystem performs the task assigned to it; rather they should only know what task a subsystem does. (c) Each subsystem should be self-contained and independent (d) Each subsystem should know what other subsystems do and how to send requests to them for assistance so that it can cooperate with them to get its own job done (e) Subsystem should hide from outside world the data it uses (f) The subsystem should be designed to be reusable
Object-oriented modeling is used in practice as it • Facilitates changing of system to improve functionality during the system life time • Facilitates reuse of code of each of the subsystems used to design the large system • Facilitates integrating subsystems into a large system • Facilitates design of distributed systems
Object Model: Three concepts are critical to understanding object models. They are:
Data abstraction Encapsulation Inheritance
An Object diagram focuses on some particular set of object instances and attributes, and the links between the instances. A correlated set of object diagrams provides insight into how an arbitrary view of a system is expected to evolve over time. Object diagrams are more concrete than class diagrams, and are often used to provide examples, or act as test cases for the class diagrams. Only those aspects of a model that are of current interest need be shown on an object diagram.
Dynamic Models: Dynamic model diagrams show how runtime objects act out a use case by sending messages to each other. There are two sorts of dynamic-model diagrams: Sequence Diagrams and Collaboration Diagrams. They describe how objects collaborate. (collaboration, sequence diagrams) Collaboration diagram - show how the behavior of several objects collaborating
together to fulfill a common purpose show the message flow between objects in an OO application and also imply the basic associations (relationships) between classes. State, Sequence (time focus), Collaboration (space focus), Activity (work focus), diagrams are used to express the behaviour of a system
A system has an architecture based on a dynamic object model when it stores the object model for itself in a way that can be modified dynamically. This means it will have classes like "Class", "Attribute", and "Association". I've run into a bunch of systems recently that have a dynamic object model, and have been trying to document them. Sometimes we have called this idea an "active object model", "metadata driven system", or " defined products".