34
Design Jon Walker

Design Jon Walker. More UML ● What is UML again?

Embed Size (px)

Citation preview

Page 1: Design Jon Walker. More UML ● What is UML again?

Design

Jon Walker

Page 2: Design Jon Walker. More UML ● What is UML again?

More UML

● What is UML again?

Page 3: Design Jon Walker. More UML ● What is UML again?

UML (Unified Modeling Language)

● UML is a way to model a software system● What does “model” mean?● Each UML diagram is designed to let

developers and customers view a software system from a different perspective and in varying degrees of abstraction

● UML diagrams commonly created in visual modeling tools include?

Page 4: Design Jon Walker. More UML ● What is UML again?

UML Diagrams

● Use Case● Class● Interaction (Sequence, Collaboration)● State Diagrams● Activity Diagram● Physical Diagram (Component, Deployment)

Page 5: Design Jon Walker. More UML ● What is UML again?

Use Case Diagram

● Use Case Diagram displays the relationship among actors and use cases

Page 6: Design Jon Walker. More UML ● What is UML again?

Class Diagram

● Class Diagram models class structure and contents using design elements such as classes, packages and objects. It also displays relationships such as containment, inheritance, associations and others

Page 7: Design Jon Walker. More UML ● What is UML again?

Class Diagram

Page 8: Design Jon Walker. More UML ● What is UML again?

Interaction Diagrams

● Sequence Diagram displays the time sequence of the objects participating in the interaction. This consists of the vertical dimension (time) and horizontal dimension (different objects)

● Collaboration Diagram displays an interaction organized around the objects and their links to one another. Numbers are used to show the sequence of messages.

Page 9: Design Jon Walker. More UML ● What is UML again?

Sequence Diagram

Page 10: Design Jon Walker. More UML ● What is UML again?

Collaboration Diagram

Page 11: Design Jon Walker. More UML ● What is UML again?

State Diagrams

● State Diagram displays the sequences of states that an object of an interaction goes through during its life in response to received stimuli, together with its responses and actions.

Page 12: Design Jon Walker. More UML ● What is UML again?

State Diagram

Page 13: Design Jon Walker. More UML ● What is UML again?

Activity Diagrams

● Activity Diagram displays a special state diagram where most of the states are action states and most of the transitions are triggered by completion of the actions in the source states. This diagram focuses on flows driven by internal processing.

Page 14: Design Jon Walker. More UML ● What is UML again?

Activity Diagram

Page 15: Design Jon Walker. More UML ● What is UML again?

Physical Diagram

● Component Diagram displays the high level packaged structure of the code itself. Dependencies among components are shown, including source code components, binary code components, and executable components. Some components exist at compile time, at link time, at run times well as at more than one time.

● Deployment Diagram displays the configuration of run-time processing elements and the software components, processes, and objects that live on them. Software component instances represent run-time manifestations of code units.

Page 16: Design Jon Walker. More UML ● What is UML again?

Component Diagram

Page 17: Design Jon Walker. More UML ● What is UML again?

Why Would You Use...

● Use Case● Class● Interaction (Sequence, Collaboration)● State Diagrams● Activity Diagram● Physical Diagram (Component, Deployment)

Page 18: Design Jon Walker. More UML ● What is UML again?

Class Diagrams Revisited

● What are the elements?

Page 19: Design Jon Walker. More UML ● What is UML again?

Class Icon

● Class● Attribute● Operation()

Page 20: Design Jon Walker. More UML ● What is UML again?

Composition

● The black diamond represents composition● What would this code look like?

Page 21: Design Jon Walker. More UML ● What is UML again?

Circle Contains a Point

Page 22: Design Jon Walker. More UML ● What is UML again?

What Kind of a Relationship is Composition?

● How are objects/classes related?

Page 23: Design Jon Walker. More UML ● What is UML again?

Composition = Has A

● A circle “has a” point

Page 24: Design Jon Walker. More UML ● What is UML again?

Inheritance

● Arrowhead indicates inheritance

Page 25: Design Jon Walker. More UML ● What is UML again?

What Kind of a Relationship is Inheritance?

● How are objects/classes related?

Page 26: Design Jon Walker. More UML ● What is UML again?

Inheritance = Is A

● A circle “is a” shape

Page 27: Design Jon Walker. More UML ● What is UML again?

Aggregation

● An open diamond denotes the weak form of aggregation

● An aggregation is a whole/part relationship● Note that the ends of the relationship are

referred to as “roles” in UML

Page 28: Design Jon Walker. More UML ● What is UML again?

Aggregation

● What else do you notice about this diagram?● What would the code look like?

Page 29: Design Jon Walker. More UML ● What is UML again?

Window Contains Shapes

Page 30: Design Jon Walker. More UML ● What is UML again?

Generic Associations

● Weaker than Aggregation● Solid line with an arrow head● How would this be implemented?

Page 31: Design Jon Walker. More UML ● What is UML again?

Dependency

● Even weaker than associations● Dashed line with an arrow head● How would this be implemented?

Page 32: Design Jon Walker. More UML ● What is UML again?

Others

Page 33: Design Jon Walker. More UML ● What is UML again?

What can you do with UML?

● Communicate to others● Translate into code

Round trip engineering

Page 34: Design Jon Walker. More UML ● What is UML again?

Let's Try

● Google Calendar