Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 The Unified Modeling Language is a visual language used to create models of programs.

Similar presentations


Presentation on theme: "CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 The Unified Modeling Language is a visual language used to create models of programs."— Presentation transcript:

1 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 The Unified Modeling Language is a visual language used to create models of programs. UML has several different diagrams. Each diagram shows the relationship among different sets of entities, depending upon the purpose of the diagram. Use Case (Analysis Phase) involve entities interacting with the system Interaction Diagrams (Looking at Objects Interactions) Shows how specific objects interact with each other Class Diagrams (Design Phase) detail the relationships between classes State Diagrams (Looking at Objects Behaviors) Detail the different states an object may be in as well as the transitions between states Deployment Phase (Deployment Phase) How different modules will be deployed.

2 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 Class Diagram – describes classes and shows the relationships between them. When one class is a “kind of” another class; the is-a relationship When there are associations between two classes –One class “contains” another class: the has-a relationship Composition: the contained item is part of the containing item (an engine in a car) Composition: the contained item is part of the containing item (an engine in a car) Aggregation: the contained item is part of a collection of items (airplanes in an airport) Aggregation: the contained item is part of a collection of items (airplanes in an airport) –One class “uses” another class: the uses-a relationship –One class “creates” another class

3 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 A rectangle represents a class. Three aspects to the rectangle/class are: –The name of the class –The data members of the class –The methods of the class The following three figures show just a class defined, a class with a public method, and a class with a private attribute and a public method respectfully.

4 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 A rectangle represents a class with it’s name at the top. The next section of the rectangle lists the attributes in the class. Each attribute contains: –A scope identifier (Public (+), private (-), protected (#). –The name of the attribute –A colon –The data type of the attribute The final section of the rectangle lists the methods of the class. Each method contains: –A scope identifier (Public (+), private (-), protected (#). –The name of the method –The parameters, if they exist, for the method. –A return value for the function, if it exists.

5 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 UML Notation for Relationships You can use UML to notate which accessibility you want each member to have. The most common follow, A aggregates B, A is composed of B, B is derived from A, and A depends on B respectively.

6 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 UML Notation for Relationships You can use UML to notate which accessibility you want each member to have. The most common follow, A aggregates B, A is composed of B, B is derived from A, and A depends on B respectively.

7 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 Class diagram, showing the is-a relationship of the most basic example of our case study. Note there are no attributes or methods, just the relationships between classes.

8 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 Class diagram, showing the has relationship between an airport and aircraft as well as an is-a relationship between a Jet/Helicopter and the Aircraft.

9 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 Technically, the Aircraft is an abstract class. In UML this is shown by writing the name of the class in italics.

10 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 No markup language is perfect, so UML gives you the ability to add notes to your diagram.

11 CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 UML will also allow you to show cardinality. Here 1 car has 4 or 5 tires. In addition, it shows that a car is dependent upon a gas station.


Download ppt "CS 350 – Software Design UML – The Unified Modeling Language – Chapter 2 The Unified Modeling Language is a visual language used to create models of programs."

Similar presentations


Ads by Google