190 likes | 297 Views
Enterprise & Application Frameworks. Dr. M.E. Fayad, Professor Computer Engineering Department – RM# College of Engineering San José State University One Washington Square San José, CA 95192-0180 URL: http://www.cmpe.sjsu.edu/~fayad. Class Diagrams-Part II. Acknowledgements.
E N D
Enterprise & Application Frameworks Dr. M.E. Fayad, Professor Computer Engineering Department – RM# College of Engineering San José State University One Washington Square San José, CA 95192-0180 URL: http://www.cmpe.sjsu.edu/~fayad SJSU – CmpE
Class Diagrams-Part II SJSU – CmpE M.E. Fayad
Acknowledgements • “Developing Software With UML: Object Oriented Analysis and Design in Practice” By: Bernd Oestereich • Using UML: Software Engineering with Objects and Components By: Rob Pooley and Perdita Stevens • “Rational Rose UML Tutorial and Demo” Rational Software Corporation SJSU – CmpE M.E. Fayad
Generalization, Specialization • Related terms: inheritance • Definition: • Inheritance is a programming language concept; an implementation mechanism for the relationship between superclasses and subclasses by means of which attributes and operations of a superclass also become accessible to its subclasses. SJSU – CmpE M.E. Fayad
Generalization, Specialization • Notation: • The inheritance relation is represented by means of a large empty arrow pointing from the subclass to the superclass. Superclass Subclass Subclass Subclass Subclass SJSU – CmpE M.E. Fayad
Generalization, Specialization • Example: GeomFigure {abstract} x: Integer y: Integer visible: Boolean display() {abstract} Remove() {abstract} moveTo(pX, pY) Circle Rectangle Triangle radius {radius >0) a {a>0} b {b>0} a {c-b<a<b+c} b {a-c<b<a+c} c {a-b<c<a+b} setRadius(pR) display() remove() setSides(pA, pB) display() remove() setSides(pA,pB,pC) display() remove() SJSU – CmpE M.E. Fayad
Multiple Inheritance • In multiple inheritance, a class can have more than one superclass. Animal Fish Habitat Mammal Terrestrial Aquatic Pig Dolphin Trout SJSU – CmpE M.E. Fayad
Multiple Inheritance • Example: Vehicle name manufacuturer LocomotionMedium {Overlapping} KindOfPower Water Vehicle Windpowered Vehicle Motor Vehicle draught displacement minWindForce maxWindForce fuelType power SailingBoat surfaceOfSails numOfSails SJSU – CmpE M.E. Fayad
Multiple Inheritance • Overlapping Versus Disjoint disjointSailingBoat overlappingSailingboat name manufacturer draught displacement surfaceOfSails numOfSails waterVehicle:name windpoweredVehicle.name waterVehicle:manufacturer windpoweredVehicle.manufacturer draught displacement surfaceOfSails numOfSails SJSU – CmpE M.E. Fayad
Behavior Diagrams SJSU – CmpE M.E. Fayad
Activity Diagrams • Related terms: object state, action state, state diagram • Description: • An activity is a single step in a processing procedure. SJSU – CmpE M.E. Fayad
Activity Diagrams SJSU – CmpE M.E. Fayad
Sequence Diagrams • Related terms: interaction diagram, event trace diagram, scenario, message diagram. • Definition: • A sequence shows a series of messages exchanged by a selected set of objects in a temporally limited situation, with an emphasis on the chronological course of events. SJSU – CmpE M.E. Fayad
Sequence Diagrams SJSU – CmpE M.E. Fayad
Collaboration Diagrams • Related terms: cooperation diagram, interaction diagram, object diagram • Definition: • A collaboration diagram shows a set of interactions between selected objects in a specific, limited situation, focusing on the relations between the objects. SJSU – CmpE M.E. Fayad
Collaboration Diagrams SJSU – CmpE M.E. Fayad
Questions? SJSU – CmpE M.E. Fayad
Rational Rose Demonstration SJSU – CmpE M.E. Fayad