An Introduction to the Unified Modeling Language A picture is worth a thousand words.
-
Upload
leslie-harrington -
Category
Documents
-
view
219 -
download
1
Transcript of An Introduction to the Unified Modeling Language A picture is worth a thousand words.
![Page 1: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/1.jpg)
An Introduction to the Unified Modeling Language
A picture is worth a thousand words
![Page 2: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/2.jpg)
Introduction
Most people refer to the Unified Modeling Language as UML.
An international industry standard graphical notation for describing software analysis and designs.
a standardized notation is used, in order to minimize the room for misinterpretation.
Therefore the error rate will be less. Continued on next
slide
![Page 3: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/3.jpg)
Introduction
The U in UML stands for unified because the UML is a unification and standardization of earlier modeling notations of Booch, Rumbaugh, Jacobson, Mellor and Shlaer.
The UML has been accepted as a standard by the Object Management Group1 (OMG).
OMG is a non-profit organization with about 700 members that sets standards for distributed object oriented computing.
![Page 4: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/4.jpg)
Use Case Diagrams
Use case- a concept invented by Ivar Jocbson. Use case typically represents a major piece of
functionality that is complete from beginning to end.
Use case diagrams are used during requirements collection and analysis as a graphical means of representing the functional requirements of the system.
In UML, a use case is represented as an ellipse
![Page 5: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/5.jpg)
Who is an actor?
An actor represents whoever or whatever interacts with the system.
The actor is not part of the system itself and represents anyone or anything that must interact with the system to:
• Input information to the system;• Receive information from the system;• Both input information to and receive
information from the system.
![Page 6: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/6.jpg)
UML SYMBOL FOR AN ACTOR
![Page 7: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/7.jpg)
• Arrows and lines are draw between actors and use cases and between use cases to show their relationships
![Page 8: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/8.jpg)
There are two kinds of relationships between use cases. They are:
«include» «extend»
![Page 9: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/9.jpg)
The «include» relationship when a chunk of behavior is similar across more than one use-case, and you don’t want to keep copying the description of that behavior
The «extend» relationship allows us to modify the behaviour of the base Use Case.
But extend relationship makes the use cases difficult to understand. So the developers very rarely use this relationship.
![Page 10: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/10.jpg)
Representation of include and extend relationship
![Page 11: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/11.jpg)
Class Diagrams
A class diagram in the Unified Modeling Language is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations, and the relationships among objects.
Class diagrams are used in both the analysis and the design phases.
![Page 12: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/12.jpg)
In UML, a class is represented by a rectangle with one or more horizontal compartments.
The upper compartment holds the name of the class. The name of the class is the only required field in a class diagram.
The center compartment of the class rectangle holds the list of the class attributes/data members.
The lower compartment holds the list of operations/methods.
![Page 13: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/13.jpg)
• The complete UML notation for a class is
![Page 14: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/14.jpg)
Static Relationships
There are two principle types of static relationships between classes: inheritance and association.
The relationships between classes are drawn on class diagram by various lines and arrows.
![Page 15: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/15.jpg)
Inheritance
Inheritance is represented with an empty arrow, pointing from the subclass to the super class.
![Page 16: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/16.jpg)
Association
An association represents a relationship between two instances of classes.
An association between two classes is shown by a line joining the two classes.
Association indicates that one class utilizes an attribute or methods of another class.
There are two different specialized types of association relationships: aggregation, and composition.
![Page 17: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/17.jpg)
Aggregation
• If the association conveys the information that one object is part of another object, but their lifetimes are independent (they could exist independently), this relationship is called aggregation.
![Page 18: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/18.jpg)
Composition
Composition is, when an object is contained in another object, and it can exist only as long as the container exists and it only exists for the benefit of the container.
![Page 19: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/19.jpg)
Attributes
Attributes or data members are shown in the middle box of the class diagram. It is optional to show the attributes.
Public attributes are denoted with a + sign, protected with a # sign, and private with a – sign.
![Page 20: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/20.jpg)
Notation for Attributes
![Page 21: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/21.jpg)
Operations
• The operations are the services that a class is responsible for carrying out. They may be specified giving their signature (the names and types of their arguments/parameters), the return type, and their visibility (private, protected, public).
![Page 22: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/22.jpg)
Notation for Operations
![Page 23: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/23.jpg)
More Advanced Class Diagram Concepts
Abstract Classes– If there is an abstract class or method, the UML
convention is to italicize the name of the abstract item.
Packages– If a system is big, it should be partitioned in
smaller sub-systems, each with its own class diagram. In UML notation, the partitions/sub-systems are called packages.
![Page 24: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/24.jpg)
Stereotypes– Stereotypes are a high-level classification of an
object that gives you some indication of the kind of object it is.
Notes– Notes are used to “attach” comments and
constraints to the model elements.
![Page 25: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/25.jpg)
Object Diagrams
An UML object diagram, on the other hand, shows a snapshot of the detailed state of a system at a point in time.
An UML object diagram shows some specific instance of the classes of the system. While there is only class diagram of the system, there may be hundreds of different object diagrams.
In an object diagram, many different instances of the same class, and no instance of other classes, may be shown.
![Page 26: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/26.jpg)
Notation for an object
![Page 27: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/27.jpg)
Sequence Diagrams
Sequence diagrams are used in the analysis and design phases.
By creating a sequence diagram, the objects that participate in the use case are identified.
Sequence diagrams highlight the sequence of messages through time.
But they do not show how objects are linked and may send messages to each other.
![Page 28: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/28.jpg)
A sequence diagram representing a player taking a turn
![Page 29: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/29.jpg)
State Diagrams
State diagrams are created during the analysis and design phase to describe the behavior of nontrivial objects.
State diagrams are good for describing the behavior of one object across several use cases.
It is used to identify object attributes and to refine the behavior description of an object.
![Page 30: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/30.jpg)
A state diagram consists of:• A state is represented by a rounded rectangle.• A start state is represented by a solid circle.• A final state is represented by a solid circle with
another open circle around it.• A transition is a change of an object from one
state (the source state) to another (the target state) triggered by events, conditions, or time.
![Page 31: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/31.jpg)
UML State Diagram for a Turn in Monopoly
![Page 32: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/32.jpg)
Activity Diagrams
Activity diagrams are used during the design phase of complex methods.
The activity diagram can also be used during analysis to break down the complex flow of a use case.
UML activity diagrams are an updated and enhanced form of flowcharts.
![Page 33: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/33.jpg)
An activity diagram explaining how to prepare corn on the cob
![Page 34: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/34.jpg)
Conclusion
• Powerful modelling language.• UML can be used for modelling the whole
system independent of platform language.• Provide users with a ready-to-use, expressive
modelling examples
![Page 35: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/35.jpg)
Reference
An Introduction to the Unified Modeling Language : Laurie Williams 2004
![Page 36: An Introduction to the Unified Modeling Language A picture is worth a thousand words.](https://reader035.fdocuments.net/reader035/viewer/2022062517/56649f135503460f94c27263/html5/thumbnails/36.jpg)
THANK YOU