Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Methodologies

Similar presentations


Presentation on theme: "Object Oriented Methodologies"— Presentation transcript:

1 Object Oriented Methodologies
Lesson06 Jerry Kotuba

2 Agenda Class Diagrams Solution I-C-E-03 & 04 Posted
Take up the Class Diagrams Class Diagrams Whole-to-part associations I-C-E-05 Object Oriented Methodologies Jerry Kotuba

3 Generalization, Inheritance & Constraints
generalization path solid line with hollow arrowhead pointing from subclass to superclass indicate basis of generalization name the path for the attribute being removed = called the discriminator discriminator shows which property is abstracted by a generalization relationship SYST Object Oriented Methodologies Jerry Kotuba

4 Constraints on Generalization
constraints on the subclasses overlapping: descendent may be descended from more than one of the subclasses student can be both a research and teaching assistant disjoint: descendent may not be descended from more than one of the subclasses patient can not be both out and resident SYST Object Oriented Methodologies Jerry Kotuba

5 Constraints on Generalization
complete: all subclasses are listed only have out and resident patients incomplete: all subclasses are not listed more subclasses are available can have casual, part-time employees SYST Object Oriented Methodologies Jerry Kotuba

6 Whole-to-Part Associations
The UML provides ways to model two types of whole-to- part associations – aggregation and composition. Object Oriented Methodologies Jerry Kotuba

7 Definitions aggregate: In an aggregation, the class representing the whole. aggregation: An association between classes representing a part-to- whole relationship in which the parts and the whole may exist independently and in which a single part may be associated with more than one whole at the same time. Object Oriented Methodologies Jerry Kotuba

8 Definitions…cont’d composite: In a composition, a class representing the whole. composition: An association between classes representing a whole-to- part relationship in which the parts may belong to only one whole at a time and the whole does not exist without its parts. Object Oriented Methodologies Jerry Kotuba

9 Example of an Aggregation
. Object Oriented Methodologies Jerry Kotuba

10 Example of a Composition
. Object Oriented Methodologies Jerry Kotuba

11 Aggregation and Composition
. Object Oriented Methodologies Jerry Kotuba

12 Categories of Whole-to-Part Associations
There are three relationships that sometimes occur in an object model: Assemblies of parts Members of groups Containers and their contents You may find these useful for making your model a better tool for understanding and communication. The model can always be built without these. They do not really affect its use for system design, just for talking to the users. Object Oriented Methodologies Jerry Kotuba

13 Assemblies of parts Taking something apart into its components is a technique we humans often use to understand how something works. Often we find it improves our understanding to model A product and its components A business consists of branches, departments, etc. A country consists of states, provinces, counties, boroughs, shires, towns, villages, cities, etc. Object Oriented Methodologies Jerry Kotuba

14 Containers and their contents
Container-Contents is a different and less common relationship. In some situations we may find it helpful to view a relationship as one of these, e.g., Truck or Aircraft and the Products or Shipments that it carries An actual shipping container and the goods it holds A ship, bus or airplane and its passengers A building and the businesses it houses. Object Oriented Methodologies Jerry Kotuba

15 Assemblies of parts Vs Containers and their contents
A Container, however, is still a perfectly good Container, even without its Contents The jar is still OK even without the “hunny.” And the Contents are perfectly OK without the Container (although the “hunny” might get all over one’s paws!) The essential difference between these relationships is that: With Assemblies of parts, if you take the component away, the assembly (whole) probably won’t work any more Take a wheel off a car Take a hand off a clock Take a leg off a table. Jerry Kotuba Object Oriented Methodologies

16 Collection-Member (members of groups)
Collection-Member is also a different and relatively uncommon relationship. Sometimes we meet an actual collection: A library full of books An art gallery A stamp or jewelry collection A fleet of trucks, ships or aircraft Other times it may help to use this to describe: A church, club or regiment and its members An inventory of furniture or equipment A herd, mob, flock, school or skein of animals. Jerry Kotuba Object Oriented Methodologies

17 Your Turn… Think about a book, which consists of a cover, table of contents, chapters and an index. Chapters in turn have pages, paragraphs and words. Show the special case of association between classes described here including the multiplicity. Object Oriented Methodologies Jerry Kotuba

18 Test Review See ICE’s on SLATE Plus Exercises 1,2,3,&4
Object Oriented Methodologies Jerry Kotuba

19 Test Review Permitted a “cheat sheet”
Satzinger – Chapters 1,2,4,5,6 (Chap 6 only to page 225 –including Activity diagrams) Plus all material covered in class…check PPTs 10 modified T/F and 15 M/C questions Exercises Event table Use Case Diagram Includes (a.k.a. Uses) Activity Diagram Class Diagram Relationships ( Multiplicity) Association Classes Subclasses & Inheritance (incl. constraint & Discriminator Notation) Generalization & Specialization Abstract Classes Permitted a “cheat sheet” One 8 ½ X 11 sheet only (both Sides) Object Oriented Methodologies Jerry Kotuba

20 Next class… Mid-term test Object Oriented Methodologies Jerry Kotuba

21 Your turn…ICE-05 SLATE2 Object Oriented Methodologies Jerry Kotuba


Download ppt "Object Oriented Methodologies"

Similar presentations


Ads by Google