39
UML by Example Barbara De Vries

UML by Example

Embed Size (px)

Citation preview

Page 1: UML by Example

UML by Example

Barbara De Vries

Page 2: UML by Example

What is UML?

Source: http://www.gdpro.com/what_is_uml.html

http://www.sdmagazine.com/articles/2000/0003/0003z/0003z.htm?topic=uml

The Unified Modeling Language (UML) was developed by Grady Booch, James Rumbaugh, and Ivar Jacobson to combine the best ideas from their respective methodologies and notations. The UML gives developers a standard way to communicate the details of system design and development.

UML is a standard way to specify, construct, and document systems. It is primarily targeted for object-oriented code such as Java, C++ or IDL.As with any language, the UML has its own notation and syntax. Its notation comprises a set of specialized shapes for constructing different kinds of software diagrams. Each shape has a particular meaning, and the UML syntax dictates how the shapes can be combined.

Although many major object-oriented analysis and design methods influenced the development of the UML, it is derived primarily from three notations: Booch OOD (Object-Oriented Design), Rumbaugh OMT (Object Modeling Technique), and Jacobson OOSE (Object-Oriented Software Engineering).

The entire UML specification and UML usage guidelines are available for viewing and download from the OMG at http://www.omg.org/uml/ .

Page 3: UML by Example

UML Diagram Types

• Use Case Diagram

• Activity Diagram

• Sequence Diagram

• Collaboration Diagram

• Component Diagram

• Class Diagram

• Deployment Diagram

• Statechart Diagram

Page 4: UML by Example

UML Roadmap

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 5: UML by Example

Diagram DefinitionsTypes of UML diagramsEach 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:

•Use Case Diagram displays the relationship among actors and use cases.

•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.

•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.

•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.

•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.

•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 6: UML by Example

Defining Use Cases and Use Case Diagrams

Source: http://www.sdmagazine.com/articles/2000/0003/0003z/0003z1.htm?topic=uml

A use case scenario is a description, typically written in structured English or point

form, of a potential business situation that an application may or may not be able to

handle. A use case describes a way in which a real-world actor-a person,

organization, or external system-interacts with your organization. For example, the

following would be considered use cases for a university information system:

•Enroll students in courses

•Input student course marks

•Produce student transcripts.

Page 7: UML by Example

Use Case - continuedUse case diagrams are straightforward, showing the actors, the use cases

with which they're involved, and the boundary of the application. An actor

is any person, organization, or system that interacts with the application but

is external to it. Actors are shown as stick figures, use cases are ovals, and

the system is a box. The arrows indicate which actor is involved in which

use cases, and the direction of the arrow indicates flow of information (in

the UML, indicating the flow is optional, although I highly suggest it). In

this example, students are enrolling in courses via the help of registrars.

Professors input and read marks, and registrars authorize the sending out of

transcripts (report cards) to students. Note how for some use cases, more

than one actor is involved, and that sometimes the flow of information is in

only one direction.

The combination of use cases and their corresponding use case diagram is

referred to as a use case model. Use case models are often accompanied by

a glossary describing the terminology used within them. The glossary and

use case model are important inputs for the development of class diagrams.

Page 8: UML by Example

Notation of the Use Case Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 9: UML by Example

Example 1: Use Case Diagram

Source: http://www.gdpro.com/uml_central.html

Page 10: UML by Example

Example 2: Use Case Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 11: UML by Example

Example 3: Use Case Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 12: UML by Example

Notation of the Activity Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 13: UML by Example

Example: Activity Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 14: UML by Example

Notation of the Sequence Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 15: UML by Example

Example: Sequence Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 16: UML by Example

Notation of the Collaboration Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 17: UML by Example

Example 1: Collaboration

Diagram

Source: http://www.ee.princeton.edu/~wolf/embedded-book/overheads/ch3-4/sld003.htm

Page 18: UML by Example

Example 2: Collaboration Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 19: UML by Example

Example 3: Collaboration Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 20: UML by Example

Example 4: Collaboration Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 21: UML by Example

Notation of the Class Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 22: UML by Example

Example 1: Class Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 23: UML by Example

Example 2: Class Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 24: UML by Example

Example 3: Class Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 25: UML by Example

Example 4: Class Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 26: UML by Example

Notation of the Component Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 27: UML by Example

Example Component Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 28: UML by Example

Notation of the Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 29: UML by Example

Example 1: Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 30: UML by Example

Example 2: Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 31: UML by Example

Example 3: Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 32: UML by Example

Example 4: Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 33: UML by Example

Example 5: Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 34: UML by Example

Example 6: Deployment Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 35: UML by Example

Notation of the Statechart Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 36: UML by Example

Example 1: Statechart Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 37: UML by Example

Example 2: Statechart Diagram

Source: Iterative UML Development by Jean Sekula and Patrick Sheridan

Page 38: UML by Example

Incorporate UML in Projects

Source: http://www.sdmagazine.com/articles/2000/0003/0003z/0003z2.htm?topic=uml

The most important things to keep in mind as you

apply UML to your project are to:

keep it simple,

write the user manual first (one use case at a time), and

get your project team on the same page regarding

process.

Remember, UML specifies a notation, not a process. The most

successful projects adopt use case-driven, iterative, and

incremental approaches.

Tailor your process to the individual parameters of your project

and to the skill set of your team

Page 39: UML by Example

UML in Projects - Continued

Source: http://www.sdmagazine.com/articles/2000/0003/0003z/0003z2.htm?topic=uml

Keep It Simple

Team members will have varied experience with object-oriented

analysis and design and UML.

One of the most important things to remember when learning UML is

that you don't need to use every construct just because it's there.

Keep the process as simple as possible.

Streamlining a project's documentation set and modeling approach

does wonders for generating forward momentum.