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-III: Relationships
• Relationships
• What is relationship?
• What is a link?
• What is an associa...
Learning Objectives
At the end of this unit the student will be in a position to:
• Understand What is Relationship and wh...
What is a Relationship
• Relationship is a semantic connection among elements.
• Relationships tie the UML things together...
Object Diagrams
• Object diagrams model the instances of things contained in the class
diagrams.
• An object diagram shows...
What is an association
• Associations are Relationships between classes.
• just as links connect objects association conne...
• Association name: An association can have a name, and you use that name to
describe the nature of the relationship
Examp...
Association relationship
Reflexive Association
When a class has an association to itself
Example
Visibility : objects at that end are not accessibl...
• Qualification : is an attribute whose values partition the set of objects related to
an object across an association.
Ex...
Aggregation
A special form of association that specifies a whole-part relationship between the
aggregate (the whole) and a...
What is Dependency
A dependency is a semantic relationship between two model elements in which a
change to one element may...
There are stereotypes that apply to dependency relationships among classes and
objects in class diagrams.
1.Bind: specifie...
Inheritance
• A very important concept in object-oriented design,
• inheritance, refers to the ability of one class (child...
Polymorphism
• The term polymorphism literally means "having many forms"
• A polymorphic operation is one that has many im...
Generalization
• Generalization is a relationship between more general things and a more
specific things
• It is a parent ...
Class inheritance
• When you arrange classes into generalization hierarchy you implicitly have
inheritance between the cla...
Advanced Generalization
• The UML defines one stereotype and four constraints that may be applied to
generalization relati...
Analysis packages
What is a package
• The package is UML mechanism for grouping things
• Container and owner of model elem...
Packages and Namespaces
• Every package must have a name that distinguishes it from other packages.
• A name is a textual ...
Nested Packages
• Packages may own other packages
• Packages may be nested inside other packages to any depth.
• Two or th...
Package Dependencies
• A dependency relationship indicates that one package depends up on other
Package.
• Any package tha...
Package Dependencies (cont..)
There are five different types of package dependencies
Supplier Client
ClientSupplier
Client...
Transitivity
• Transitivity is a term that applied to relationships.
• If there is a relationship between A and B, and a r...
Package Generalization
Generalization among packages is very much like generalization among classes.
Example:
Generalizati...
Architectural analysis
• One of the goals in Architectural analysis is to try to minimize the amount of
coupling in the sy...
Summary
• Understand What is Relationship and what is a link
• Understand what is an association, dependency, and
generali...
Glossary
• Relationship is a semantic connection among elements.
• Connections between objects are called links
• Qualific...
Quiz
1) Connection between objects are called____________?
(a) Relationship (b) link (c) Association (d) dependency
2)____...
Key:
1) b
2) c
3) d
4) b
5) a
Upcoming SlideShare
Loading in …5
×

Ooad content of unit iii

47 views

Published on

Ooad content of unit iii

Published in: Engineering
  • Be the first to comment

  • Be the first to like this

Ooad content of unit iii

  1. 1. Subject: Object Oriented Analysis and Design B.Tech III Year II-Semester Computer Science &Engineering
  2. 2. • Table of Contents Unit-III: Relationships • Relationships • What is relationship? • What is a link? • What is an association? • What is a dependency? • Inheritance and polymorphism Generalization • Class inheritance • Polymorphism Advanced generalization • Analysis Packages • What is a Package? • Packages and namespaces Nested packages • Package dependencies • Package generalization • Architectural Analysis
  3. 3. Learning Objectives At the end of this unit the student will be in a position to: • Understand What is Relationship and what is a link • Understand what is an association, dependency, and generalization • Understand packages and relationships used in packages • Use diagram notation for all relationships
  4. 4. What is a Relationship • Relationship is a semantic connection among elements. • Relationships tie the UML things together. • There are four kinds of relationships in the UML Dependency Association Generalization Realization What is a Link • Connections between objects are called links • A link is a semantic connection between objects that allows messages to be sent from one object to the other • Links are implemented in different ways by different OO languages Example: java implements links as object references C++ implements links as pointers
  5. 5. Object Diagrams • Object diagrams model the instances of things contained in the class diagrams. • An object diagram shows a set of objects and their relationships at a point in time. • You use object diagrams to model the static design view of a system. • This involves modeling a snapshot of the system. Example: object link c:Company d1:Department Name=“sales” d2:Department name=“R&D” P:Person Name=“Erin” Empid=4326 Title=“sales” :Contactinformation Address=“1472 Miller st
  6. 6. What is an association • Associations are Relationships between classes. • just as links connect objects association connect classes. • An association is a structural relationship among classes. • Specifying that objects of one thing are connected to objects of another Notation: Association ___________________ Association Syntax: Association may have • An association name • Role names • Multiplicity • Navigability Example: A Student can take many Courses and many Students can be enrolled in one Course. *
  7. 7. • Association name: An association can have a name, and you use that name to describe the nature of the relationship Example: • Association Role: When a class participates in an association, it has a specific role that it plays in that relationship Example: • Multiplicity: An association represents a structural relationship among objects. It is important to you to state how many objects may be connected across an instance of an association. This “how many” is called the multiplicity of an association role Example: Navigation: direction of traversal Example: Person Company Works for person company Employee employer Person Company 1..* * Works for Person CompanyWorks for
  8. 8. Association relationship
  9. 9. Reflexive Association When a class has an association to itself Example Visibility : objects at that end are not accessible to any objects outside the association. Example: association : Association visibility
  10. 10. • Qualification : is an attribute whose values partition the set of objects related to an object across an association. Example: Association Class: In an association between two classes, the association itself might have properties. Example: in an employer/employee relationship between a company and a person there is a employment that represents the properties of that relationship
  11. 11. Aggregation A special form of association that specifies a whole-part relationship between the aggregate (the whole) and a component ( the part). Has-a relationship. Example: Company has several departments. Composition Composition is a form of aggregation, with strong ownership Example: Window Frame whole 1 part *
  12. 12. What is Dependency A dependency is a semantic relationship between two model elements in which a change to one element may affect the semantics of the other elements Notation: FlimClip name playOn(c:Channel) Start() Stop() Reset() channel dependency
  13. 13. There are stereotypes that apply to dependency relationships among classes and objects in class diagrams. 1.Bind: specifies that the source instantiates the target template using the given actual parameters 2.Derive: specifies that the source may be computed from the target 3. permit: specifies that the source is given special visibility into the target 4. Instance of: specifies that the source object is an instance of the target 5. instantiate: specifies that the source creates instances of the target 6.powertype: specifies that the target is a power type of the source 7.refine: specifies that the source is at a finer degree of abstraction than the target 8. use: specifies that the semantics of the source element depends on the semantics of the public part of the target Permission dependencies 1.import: specifies that the public contents of the target package enter the public namespace of the source. 2.access: specifies that the public contents of the target package enter the private namespace of the source.
  14. 14. Inheritance • A very important concept in object-oriented design, • inheritance, refers to the ability of one class (child class) to inherit the identical functionality of another class (super class), and then add new functionality of its own. Example:
  15. 15. Polymorphism • The term polymorphism literally means "having many forms" • A polymorphic operation is one that has many implementations. • A polymorphic reference is a variable that can refer to different types of objects at different points in time Abstract super class Concrete subclass Polymorphic operations
  16. 16. Generalization • Generalization is a relationship between more general things and a more specific things • It is a parent child relationship, The child shares the structure and the behavior of the parent and the child is substitutable for parent. Example:
  17. 17. Class inheritance • When you arrange classes into generalization hierarchy you implicitly have inheritance between the classes where the subclasses inherits all the features of the super classes. Such as • Attributes • Operations • Relationships • Constraints Sub classes can also add new features and override super class operations. Example:
  18. 18. Advanced Generalization • The UML defines one stereotype and four constraints that may be applied to generalization relationships in advanced generalization. Stereotype • <<Implementation>>: specifies that the child inherits the implementation of the parent. Constraints • Complete : specifies that all children in the generalization have been specified in the model and that no additional children are permitted • Incomplete : specifies that not all children in the generalization have been specified and that additional children are permitted • Disjoint : Specifies that objects of the parent may have no more than one of the children as a type • Overlapping: specifies that objects of the parent may have more than one of the children as a type
  19. 19. Analysis packages What is a package • The package is UML mechanism for grouping things • Container and owner of model elements • Each package has its own namespace within which all names must be unique • Every model element is owned by one package • The packages form a hierarchy Examples: +OrderForm +TrackingForm -Order client Business rules
  20. 20. Packages and Namespaces • Every package must have a name that distinguishes it from other packages. • A name is a textual string That name alone is known as a simple name • A path name is the package name prefixed by the name of the package in which that package lives. Example for path name: Library::Users::Librarian Library Users Librarian
  21. 21. Nested Packages • Packages may own other packages • Packages may be nested inside other packages to any depth. • Two or three levels of nesting is enough . • If more than three levels of nesting is used it will difficult to understand and navigate Example: The package Camera can be navigated Sensors::Vision::Camera Sensors Vision Camera
  22. 22. Package Dependencies • A dependency relationship indicates that one package depends up on other Package. • Any package that has a dependency relationship with other package .the depended package will be able to see the public elements of that package ,but will not be able to see the private elements .
  23. 23. Package Dependencies (cont..) There are five different types of package dependencies Supplier Client ClientSupplier ClientSupplier Design modelAnalysis model ClientSupplier <<use>> <<import>> <<access>> <<trace>> <<merge>> An element in the client package uses a public element in the supplier package Elements in the client can access all public elements in the supplier package Elements in the client can access all public elements in the supplier package <<trace>> usually represents historical development of one element into another more developed version. Public elements of the supplier package are merged with elements of the client package
  24. 24. Transitivity • Transitivity is a term that applied to relationships. • If there is a relationship between A and B, and a relationship between A and C Then there is an implicit relationship between A and C • <<import>> is Transitive <<access>> is not transitive. A B C <<access>> <<access>>
  25. 25. Package Generalization Generalization among packages is very much like generalization among classes. Example: Generalization • The package GUI is shown to export two classes(Window and Form) and one protected class(EventHandler). • Two packages specialize the more general package GUI:WindowsGUI and MacGUI. • These specialized packages inherit the public and protected elements of the more general package . GUI +Window +Form #EventHandler WindowsGUI +GUI::Window +Form #GUI:EventHandler MacGUI
  26. 26. Architectural analysis • One of the goals in Architectural analysis is to try to minimize the amount of coupling in the system. You can do this in three ways 1. Minimize the dependencies between analysis packages 2. Minimize the number of public elements in each analysis package 3. Minimize the number of private elements in each analysis package.
  27. 27. Summary • Understand What is Relationship and what is a link • Understand what is an association, dependency, and generalization • Understand packages and namespaces in packages • Knows nested packages and relationship used in packages • Use diagram notation for all relationships
  28. 28. Glossary • Relationship is a semantic connection among elements. • Connections between objects are called links • Qualification : is an attribute whose values partition the set of objects related to an object across an association. • Association Class: In an association between two classes, the association itself might have properties. • A dependency is a semantic relationship between two model elements in which a change to one element may affect the semantics of the other elements • The term polymorphism literally means "having many forms“ • Generalization is a relationship between more general things and a more specific things • The package is UML mechanism for grouping things
  29. 29. Quiz 1) Connection between objects are called____________? (a) Relationship (b) link (c) Association (d) dependency 2)____________ is an attribute whose values partition the set of objects related to an object across an association. (a) Association role (b) Association class (c) Qualifier (d) Multiplicity 3) _____________ is a whole-part relationship a) Association b) dependency c) Composition d) aggregation 4) ______________ means "having many forms" a) Encapsulation b) polymorphism c) multiplicity d) aggregation 5) __________is a UML mechanism for grouping things a) package b) stereotype c) Relationship d) none
  30. 30. Key: 1) b 2) c 3) d 4) b 5) a

×