Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Subject: Object Oriented Analysis and Design
B.Tech III Year II-Semester
Computer Science &Engineering
Table of Contents
Unit-V: The Design Workflow
• Introduction
• Design artifacts
• Design workflow
• Unified Process activi...
Learning Objectives
At the end of this unit the student will be in a position to:
• Model applications using UML
• Impleme...
Introduction
The Unified Process is a software Development Process
A Software Development Process is a collection of activ...
Software Development Life Cycle
Design Workflow
The design work flow is the key modelling activity takes place during the last
part of the elaboration pha...
Analysis and Design Model
Real-world Problem
Solution domain
representation
Problem domain
representation
Analysis
Design
...
Comparison of the Analysis and Design Model
Analysis Model
• Analysis is a Conceptual Model
• Design-generic
• Less formal...
Design Artifacts-meta model
Meta model: The Design model contains many design sub systems.
These subsystems are components...
Relationships between the analysis and design artifacts
Design models are made up of
i) Design subsystems
ii) Design class...
Design Workflow: Which strives to preserve a structure of the system as
imposed by the analysis model, and which works as ...
Design workflow Detail:
Architect
Architectural design
Use case Engineer
Design a use case
Component Engineer Design a cla...
Design workflow Detail:
 The Architect: The Creation of the design is initiated by the Architect, who
outline the nodes a...
UP Activity
<<Subsystem>>
Use case model
Requirements model
Analysis model
Architecture description
Architect
Architectura...
Design Classes
The next activities in design workflow are design a class and design a use case.
These two activities occur...
Design Classes (cont..)
• Analysis is about modelling what the system should do
• Design is about modelling how that behav...
Analysis
Bank Account
name
number
balance
Deposit()
Withdraw()
Calculate interest()
Bank Account
-name : String
-number : ...
Well Formed Design classes
Four minimal characteristics that a design class must have to be
considered well formed.
• Comp...
•
High cohesion:
Cohesion refers to what the class will do.
High cohesion mean that the class is focused on what it should...
Inheritance
• Inheritance is a mechanism by which more specific classes (subclasses or
derived classes) incorporate struct...
Multiple inheritance: refer to the ability of a class to inherit behaviors and
features from more than one super class.
Ex...
aggregation and association
An aggregation is a special form of association that models a whole-part
relationship between ...
Inheritance versus Interface realization
With Inheritance we can get two things.
 Interface- the public operations of the...
Templates
• Templates allow us to parameterize a type
• Instead of specifying the actual type of attributes, operations, r...
Nested Classes
Place a class definition inside another class definition
Windows
Example: windows are part of wall and a wi...
Refining analysis relationships
Refining analysis relationships
Relationships captured in analysis are not implementable i...
Refining analysis relationships (cont..)
Association relationship must have
 Navigability: Direction
 Multiplicity: How ...
Association Types
Aggregation: Special form of association
Specifies a whole- part relationship
–symbolized by a clear whi...
How to Refine analysis relationships
• A one- to-one associations: Becomes composition
• A many-to- one association: can r...
Refied relationships
• These relationships are not directly supported by any of the commonly
used Object Oriented Language...
Bidirectional Association
A Theatre class uses the services of movie class and movie class uses the
services of theatre cl...
Association classes
A modelling element that has both associations and class properties
Example: 1..* *
Person Committe
Me...
Structured classifiers
Structured classifier is simply a class that has an internal structure
 A role name: when a class ...
Structured Classes
Structured Classes
Glossary
 Unified Process: A unified process is a software development process
which provides a disciplined approach to a...
Quiz
1)Where the design workflow take places in the Software Development Life Cycle
a) First part of the Elaboration Phase...
5) What are the three purposes of Analysis and Design?
a) to provide an organizational context for the system
b) to transf...
9) How will you refine a one-to-one association in design model
a) Aggregation b) Composition c) interface d) Generalizati...
KEY
1) B 2) C 3) C 4) A,D 5) B,C,E
6) A 7) B 8) A 9) B 10) A
THANK YOU
Ooad content of unit v
Upcoming SlideShare
Loading in …5
×

Ooad content of unit v

41 views

Published on

Ooad content of unit v

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Ooad content of unit v

  1. 1. Subject: Object Oriented Analysis and Design B.Tech III Year II-Semester Computer Science &Engineering
  2. 2. Table of Contents Unit-V: The Design Workflow • Introduction • Design artifacts • Design workflow • Unified Process activity • Architectural Design • Design Classes • Well formed design Classes • Inheritance, Templates, Nested Classes • Design Relationships • Aggregation and Composition • Refine Analysis Relationships • Structured Classes
  3. 3. Learning Objectives At the end of this unit the student will be in a position to: • Model applications using UML • Implement the software based on the design • Understand the design workflow • Understand the main principles of good Object Oriented design • Understand the advantages of Design Templates. • Describe the object-oriented software development process, including object-oriented methodologies and workflows. • Build libraries of re-useable classes using generalization and inheritance. • Model the use of technology and frameworks as series of design patterns. • Generate frame code and keep the design and code models synchronized.
  4. 4. Introduction The Unified Process is a software Development Process A Software Development Process is a collection of activities needed to transform a user’s requirements into a software System. The Unified process repeats over a series of cycles making up the life of a system.  Each cycle consists of four phases Inception: a good idea is developed into a vision of the end product Elaboration: system architecture is designed Construction: the product is built Transition: the product is released  The several core workflows in Unified process takes place over the four phases Requirement workflow: describes how to capture the requirements Analysis workflow: analyzes the requirements by refining and structuring them Design workflow: describes the design model Implementation workflow: Describes the implementation model Test workflow: describes the test model
  5. 5. Software Development Life Cycle
  6. 6. Design Workflow The design work flow is the key modelling activity takes place during the last part of the elaboration phase and the first half of the construction phase. The aim of the design workflow is to refine the analysis workflow until that can be implemented by the programmers. Many nonfunctional requirements need to be finalized at this time, including • Choice of programming language • Reuse issues • Portability issues Analysis and design can occur in parallel to some extent The purpose in analysis is to capture the functionalities that the system should provide. The purpose in design is to specify fully how this functionality will be implemented.
  7. 7. Analysis and Design Model Real-world Problem Solution domain representation Problem domain representation Analysis Design •Analysis classes comes from the real-world problem and it will give representation of the problem domain •Design classes comes from the problem domain to solution domain
  8. 8. Comparison of the Analysis and Design Model Analysis Model • Analysis is a Conceptual Model • Design-generic • Less formal • Less expensive to develop • Few layers • Outline the design of the system • May not be maintained throughout the complete software life cycle • Defines a structure that is an essential input to shaping the system Design Model • Design is a Physical Model • Not generic • More formal • More expensive • Many layers • Manifests the design of the system • Should be maintained throughout the complete software life cycle • Shapes the system trying to preserve the structure defined by the analysis model
  9. 9. Design Artifacts-meta model Meta model: The Design model contains many design sub systems. These subsystems are components that contain many different types of modelling elements. ssuch as classes, use cases, components and relationships among them. Example: Design Model <<Sub system1>> <<Sub system2>>
  10. 10. Relationships between the analysis and design artifacts Design models are made up of i) Design subsystems ii) Design classes iii) Interfaces iv) Use case realizations design ------------------------------ ------------------------------------ ------------------------------------ Analysis Package Design subsystem 0..* <<trace>> 0..* Analysis class Design class <<Interface>> Interface 1 <<trace>> 0.. * 0.. * 1 <<trace> 1 Use case realization -analysis Use case realization- design
  11. 11. Design Workflow: Which strives to preserve a structure of the system as imposed by the analysis model, and which works as a blueprint of the implementation The design model includes • Design subsystems • Design Classes • Use-case realizations • The Architectural view of the design model The Participants in design workflow are  the architect  the use case engineer and  the component engineer.  The architect will do architectural design.  The use case engineer will design a use case.  The component engineer will design classes and sub systems.
  12. 12. Design workflow Detail: Architect Architectural design Use case Engineer Design a use case Component Engineer Design a class Design a sub system
  13. 13. Design workflow Detail:  The Architect: The Creation of the design is initiated by the Architect, who outline the nodes and major subsystems and their interfaces.  The use-case engineer: realize each use case.  Component engineer: is responsible for creating design class, design sub system, and interface. UP activity: Architectural design. In UP, Architectural design is important in the whole design process. Architectural design activity is performed by one or more architects. Architectural Design will identify  Nodes and their Network configuration  Subsystems and their interfaces  Architecturally significant design classes, such as active classes  Generic design mechanisms that handle common requirements
  14. 14. UP Activity <<Subsystem>> Use case model Requirements model Analysis model Architecture description Architect Architectural design Subsystem (outlined) Interface (Outlined) Design class (outlined) Deployment model (outlined) Architecture description Architectural design.
  15. 15. Design Classes The next activities in design workflow are design a class and design a use case. These two activities occur concurrently and iteratively. The Design classes comes from problem domain and the solution domain. Use case realization design Design class (Outlined Interface (outlined) Analysis class (complete) Component engineer Design a class Interface (complete) Design class (complete)
  16. 16. Design Classes (cont..) • Analysis is about modelling what the system should do • Design is about modelling how that behaviour maybe implemented. • The design classes need to be complete enough to perform the task efficiently, i.e. • Fully specify the attributes including name, type, visibility and a default value. • Fully specify the operations including name, parameter list and return type. Examples for Analysis class and Design Class College Name Address Add student Get student Add department college -Name: Name -Address: String -Phone: Number +AddStudent(name,addr,ph) +RemoveStudent(name) +GetStudent(name) +addDepartment(did) +removeDepartment(did) +getDepartment(did) ----------------------------- <<trace>>
  17. 17. Analysis Bank Account name number balance Deposit() Withdraw() Calculate interest() Bank Account -name : String -number : String -balance : double = 0 Design +BankAccount( name:string, number:string) +deposit( m:double) : void +withdraw( m:double) : boolean +calculate interest() : double +getName() : String +setName(n: String) : void +getAddress() : String +setAddress( a:String) : void +getBalance() : double <<trace>> constructor
  18. 18. Well Formed Design classes Four minimal characteristics that a design class must have to be considered well formed. • Complete and Sufficient: Completeness is making sure that the classes satisfy all reasonable client expectations. Sufficient is keeping the design class as simple and focussed as possible. Example: Bank account : withdrawals, deposit for Bank account we need to specify all the methods which are sufficient • Primitive: Class services should always be atomic unique and simple. Example: Person class with functions getphone(), getpersonalrecords() etc.
  19. 19. • High cohesion: Cohesion refers to what the class will do. High cohesion mean that the class is focused on what it should be doing, i.e. only methods relating to the intention of the class Example: Like a credit card validation class, which is specialized to validate credit cards only. Another Example of High Cohesion: Staff -salary -emailAddr setSalary(new Salary) getSalary() setEmailAddr(new Email) getEmailAddr() Low Coupling: •As for coupling, it refers to how two classes are related and how they dependent on each other. Being low coupling, changing something major in one class should not affect the other. Note: All good software design will go for high cohesion and low coupling.
  20. 20. Inheritance • Inheritance is a mechanism by which more specific classes (subclasses or derived classes) incorporate structure and behaviour of more general classes (super classes or base classes). • Inheritance is the strongest form of coupling between two classes. Example: Account Checking Account Savings Account Credit Account
  21. 21. Multiple inheritance: refer to the ability of a class to inherit behaviors and features from more than one super class. Ex: Multiple inheritance for Consultant Manager and Permanent Manager - both inherit from two classes Employee Temporary Employee Permanent Employee Consultant Manager Consultant Manager Director Permanent Manager
  22. 22. aggregation and association An aggregation is a special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. Employee Bank Account Savings account Checking account 1..* 0..*  Association is Symmetric  Aggregation is asymmetric Example:
  23. 23. Inheritance versus Interface realization With Inheritance we can get two things.  Interface- the public operations of the base classes  Implementation – the attributes, relationships protected and private operations of the base classes. With interface realization, you get exactly one thing:  An Interface- A set of public operations attributes and relationships that have no implementation. • Inheritance and interface realization both have some common mechanisms That allow you to define a contract that subclasses must implement. but have very different semantics and usage. • Inheritance is a kind of reuse which inheriting some implementation details such as operations, attributes, relationships form a super class • Interface realization is useful whenever you want to define a contract but are not concerned about inheriting implementation details. Note: Interface realization is more flexible and robust in some ways than inheritance.
  24. 24. Templates • Templates allow us to parameterize a type • Instead of specifying the actual type of attributes, operations, return values and operation parameters, you can define a class in terms of placeholders or parameters. These may be replaced by actual values to create new classes. example : template class Array with two formal template parameters. The first template parameter T is an unconstrained class template parameter. The second template parameter n is an integer expression template parameter. Template binding for the bound class Customers substitutes class T with class Customer and boundary n with integer value 24.
  25. 25. Nested Classes Place a class definition inside another class definition Windows Example: windows are part of wall and a window may consists of several frames of different structures. The basic features of the frame class can be inherited by Rectangle frame, circle frame etc.. Wall Frame Rectangle frame Circle frame Square frame
  26. 26. Refining analysis relationships Refining analysis relationships Relationships captured in analysis are not implementable in design model. To create a design model, you have to refine analysis association relationships Several procedures to refine analysis associations to design associations • Refining associations to aggregation or composition relationships • Implementing One-to-many associations • Implementing many-to-many associations • Implementing many-to-many associations • Implementing bidirectional associations • Implementing association classes
  27. 27. Refining analysis relationships (cont..) Association relationship must have  Navigability: Direction  Multiplicity: How many are used * => 0, 1, or more 1 => 1 exactly 3..* => 3 or more  Association Name : What relationships the object have  Role name: What role the object is playing
  28. 28. Association Types Aggregation: Special form of association Specifies a whole- part relationship –symbolized by a clear white diamond 1 1 Engine Car Composition: is entirely made of -Strong version of Aggregation -the parts live and die with the whole -symbolizes by a black diamond Aggregation Book Page Composition 1 * college Department students 1 1..* 1 * composition Aggregation Examples:
  29. 29. How to Refine analysis relationships • A one- to-one associations: Becomes composition • A many-to- one association: can refine into aggregation one- to- one Each student must carry exactly one ID card Student -idCard: IDCard ID Card -name: String -id: int -password: String Many- to- one One rectangle list can contain many rectangles Rectangle -x: int -y: int + Rectangle(x: int, y: int, width:int, length: int +contains(p: point): boolean +distance(r: Rectangle): double RectangleList -list: ArrayList +add(r: Rectangle) +clear() 1 Carries 1 * contains 1
  30. 30. Refied relationships • These relationships are not directly supported by any of the commonly used Object Oriented Languages • The process of taking pure relationships and implementing them is known as reification Reify analysis relationships are • Many-to-many association • Bidirectional association • Association classes we have refied many -to-many association relationship into Aggregation & composition 1 * * 1 * Attends * Student Courses Student Attends Courses Example:
  31. 31. Bidirectional Association A Theatre class uses the services of movie class and movie class uses the services of theatre class . Example: theatre class can premier several movies. movies are part of Theatre i.e Aggregation. Movie premiered by Theatre i.e dependency. Note: The bidirectional association is refied into aggregation and association Movie Theatre Theatre 1 * Movie Premiered by
  32. 32. Association classes A modelling element that has both associations and class properties Example: 1..* * Person Committe Membership Person Membership role:Role 1 * * 1 Committe role:Role Association class is refied into two aggregation relationships
  33. 33. Structured classifiers Structured classifier is simply a class that has an internal structure  A role name: when a class participates in an association, it has a specific role that it plays in that relationship  A type: Only instances of that type can play the role  A multiplicity: state how many objects may be connected across an instance of an association 1 * User key user:integer Password:string multiplicity Role name Example: type
  34. 34. Structured Classes
  35. 35. Structured Classes
  36. 36. Glossary  Unified Process: A unified process is a software development process which provides a disciplined approach to assigning tasks and responsibilities within a development organization.  Interface: Is a named set of operations that characterizes the behavior of an element.  Workflows: A workflow is a sequence of activities that produces a result of observable value.  Work flow details: these are used in the unified process to express a specific group of closely related activities.  Classifier: A Mechanism that describes structural and behavioral features.  Generalization: A Specialization relationship, in which objects of the Specialized element is substitutable for the generalized elements
  37. 37. Quiz 1)Where the design workflow take places in the Software Development Life Cycle a) First part of the Elaboration Phase b) Last part of the Elaboration phase c) First part of the Transition Phase d) Last part of the Construction phase 2) Design Classes Comes from the --------- a) Problem domain b) Solution Domain c) both a & b d) none 3) Good Software design will go for a) High Coupling b) Low Cohesion c) High Cohesion and Low Coupling d) Low Cohesion and High Coupling 4) Which two statements are true about interfaces? a) The interface should have a clear purpose. b) A single interface should include as many possible methods, if not all methods, that may be shared by objects that implement the interface. c) An interface should be used to restrict which methods are exposed to a client. d) Classes may have multiple interfaces depending on the purpose of each interface it implements.
  38. 38. 5) What are the three purposes of Analysis and Design? a) to provide an organizational context for the system b) to transform the requirements into a design of the to-be system c) to evolve a robust architecture for the system d) to scope the system to be built and describe what it must do e) to adapt the design to match the implementation environment 6) What happens when a super class is changed? a) All subclasses inherit the change. b) The operations of the subclass must be changed. c) Additional operations in the subclass that are not associated with the super class must change. d) Only the operations of the super class are inherited. 7) Inheritance is the strongest form of _______________ between two classes a) Cohesion b) Coupling c) both a & b d) none 8) Aggregation is ___________________ a) Asymmetric b) Symmetric c) both a & b d) none
  39. 39. 9) How will you refine a one-to-one association in design model a) Aggregation b) Composition c) interface d) Generalization 10) Bidirectional association can be refied in to ______________ a) Aggregation and unidirectional association b) Aggregation and bidirectional association c) Aggregation and dependency d) Aggregation and generalization
  40. 40. KEY 1) B 2) C 3) C 4) A,D 5) B,C,E 6) A 7) B 8) A 9) B 10) A
  41. 41. THANK YOU

×