Intro Uml


Published on

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • This is a brief introduction to the Unified Modeling Language. Before looking into the UML we will recap a few principles and terms of object-orientation. We’ll then look at each of the eight different UML diagrams and show where they are used in the system development life cycle.
  • Intro Uml

    1. 1. Unified Modeling Language Overview 1. Object-orientation: Terms and concepts. 2. Use Cases: Requirements model 3. Class Diagram: The static model 4. Behavioral Modeling: The four dynamic diagrams 5. Implementation: The two physical models Software and Language Technology Engineering IR&D
    2. 2. Introduction <ul><li>Object-Oriented (O-O) systems development is a way to develop software by building self-contained modules that can be more easily: </li></ul><ul><ul><li>Replaced </li></ul></ul><ul><ul><li>Modified </li></ul></ul><ul><ul><li>and Reused. </li></ul></ul>
    3. 3. Transitioning to Object-Orientation Functional Decomposition vs. Object-Orientation <ul><li>Focus on verbs </li></ul><ul><li>Focus on process </li></ul><ul><li>Describe interactions </li></ul><ul><li>Vague partitioning rules </li></ul><ul><li>Analysis and design separate </li></ul><ul><li>Focus on nouns </li></ul><ul><li>Focus on behavior </li></ul><ul><li>Describe messages </li></ul><ul><li>Rules on encapsulation </li></ul><ul><li>Analysis and design blend </li></ul>
    4. 4. Object-Oriented Terms <ul><li>Object : Anything that models “things” in the real world. These “things” may be physical entities such as airplanes, or events such as a conference, or abstractions and logical concepts. </li></ul><ul><ul><li>An object is an instance of a class. </li></ul></ul><ul><li>Class : A template that defines the structure and capabilities of an object instance. The class definition includes the state data and the behaviors (methods) for the instances of that class. </li></ul><ul><li>Abstract class : A class that can only be used as the base class of some other class. (e.g. Geometric Shape vs. Circle). </li></ul>
    5. 5. Object-Oriented Terms (cont.) <ul><li>Attribute : Classes use attributes to store information about themselves (state information). </li></ul><ul><li>Operation : An action or transformation that a class performs or is performed on a class . </li></ul><ul><li>Method : Internal implementation of an operation for a specific object . </li></ul><ul><li>Service : Just a kind of method, but provides access to related functions sharing some common purpose. </li></ul>
    6. 6. An Example of a Class Employee Name DateOfBirth HomePhoneNo Title (etc.) listDepartmentsWorked() assignToSupervisior() computeVacation() listEmployees() (etc.) Class Name Attributes Operations
    7. 7. Object-Oriented Properties <ul><li>Inheritance : Parent/Child relationship among classes. A subclass inherits all attributes and behavior of the superclass. </li></ul><ul><li>Polymorphism : A request-handling mechanism that selects a method based on the type of the target object. </li></ul><ul><li>Encapsulation : The act of grouping both data and methods into a single object . </li></ul><ul><li>Information Hiding : Objects hide their internal structure from their surroundings. </li></ul>
    8. 8. Object-Oriented Properties (cont.)
    9. 9. Eight (or Nine, or Ten) UML Diagrams <ul><li>Use-case diagram </li></ul>Requirements Behavioral view (dynamic) <ul><li>Sequence diagram (an OID) </li></ul><ul><li>Collaboration diagram (an OID) </li></ul><ul><li>State Chart diagram </li></ul><ul><li>Activity diagram </li></ul>Implementation view <ul><li>Component diagram </li></ul><ul><li>Deployment diagram </li></ul>Organize Models <ul><li>Package </li></ul><ul><li>Object diagram </li></ul>Static view <ul><li>Class diagram </li></ul>Class Instances Model
    10. 10. Use Cases <ul><li>Use cases are graphical scenarios for understanding system requirements. </li></ul><ul><ul><li>A textual scenario accompanies each use case. </li></ul></ul><ul><li>A use case is a specific interaction between users (actors) and some system functionality. </li></ul><ul><li>The use-case model captures the goal of the user and the responsibility of the system to its users. </li></ul>Library System Check out books Read books, Newspapers Member Supplier Purchase Supplies Get Interlibrary loan
    11. 11. Class Diagram <ul><li>The UML class diagram is the static analysis and design diagram. </li></ul><ul><li>Class diagrams show the static structure of the model. </li></ul><ul><li>The class diagram is collection of static modeling elements, such as classes and the relationships among the data. </li></ul>
    12. 12. Class Diagrams (cont.) <ul><li>In class notation, either or both the attributes and operation compartments may be suppressed. </li></ul>Boeing 737 length: meter fuelCapacity: Gal doors: int lift ( ) roll ( ) Boeing 737 Boeing 737 length: meter fuelCapacity: Gal doors: int thrust ( )
    13. 13. Object/Class Relationships <ul><li>Three types of relationships among classes (or among objects, for that matter) are: </li></ul><ul><ul><li>Association. </li></ul></ul><ul><ul><li>Generalization. </li></ul></ul><ul><ul><li>Aggregation (consists of). </li></ul></ul><ul><ul><ul><li>Composition (a-part-of). </li></ul></ul></ul>A Stronger Aggregation
    14. 14. UML Association Notation <ul><li>In the UML, a navigable association is represented by an open arrow. </li></ul>BankAccount Person BankAccount Person <ul><li>A bidirectional association does not have an arrow. </li></ul>
    15. 15. UML Binary Association Notation <ul><li>A binary association is drawn as a solid path connecting two classes or both ends may be connected to the same class. </li></ul>Company Person Works For employer employee Person Married To <ul><li>Note: </li></ul><ul><li>Association Name </li></ul><ul><li>Association Roles </li></ul>
    16. 16. Qualifiers and Multiplicity <ul><li>A qualifier is an association attribute. Account# is an attribute of Bank, but is important enough to note as the qualifier in the association . </li></ul><ul><li>Multiplicity specifies the range of allowable associated classes. </li></ul>. Bank Person accountNo 0..1 *
    17. 17. UML Association Class <ul><li>An association class is an association that also has class properties. </li></ul><ul><li>An association class is shown as a class symbol attached by a dashed line to an association path. </li></ul>WorksFor Person employer employee Company salary
    18. 18. UML N-Ary Association <ul><li>An n-ary association is an association among more than two classes. </li></ul><ul><li>The n-ary association is more difficult to understand. It is better to convert an n-ary association to binary association. </li></ul>GradeBook Student class Class grade exam lab Year semester * * * student
    19. 19. Generalization Relationships <ul><li>Generalization is a form of association. </li></ul><ul><li>Sub-classes are specialized versions of their super-classes. </li></ul>Vehicle Bus Truck Car Boeing 737 BoeingAirplane Boeing 757 Boeing 767 Shared target style Separate target style
    20. 20. Aggregation Relationships <ul><li>Aggregations are a-part-of relationships, where a class consists of several component classes. </li></ul><ul><li>Aggregation is a special form of association. </li></ul>Player class Team 1 * Consists Of
    21. 21. UML Composition <ul><li>Compositions are aggregations with strong ownership. They use solid diamonds. When the composition dies, all components die too. </li></ul>Car 4 Wheel Light Door Engine 4, 10 2, 5 1 1 1 1 1 nested composition graphical composition Wheel 4 Door 2,5 Engine 1 Car 4,10 Light
    22. 22. Object Diagram <ul><li>The UML object diagram is the static analysis and design diagram using specific, named objects . </li></ul><ul><li>Object diagrams follow the same rules as class diagrams. </li></ul><ul><li>The object diagram may be used to model a concrete instance of a use case. </li></ul><ul><ul><li>It helps understand the emerging system model. </li></ul></ul><ul><ul><li>After it is abstracted into a class diagram, it may be discarded. </li></ul></ul>
    23. 23. Four UML Behavior Diagrams <ul><li>1. Sequence diagram (an OID*) </li></ul><ul><li>2. Collaboration diagram (an OID*) </li></ul><ul><li>3. State Chart diagram </li></ul><ul><li>4. Activity diagram </li></ul><ul><li>Behavioral (dynamic) models reflect system processes over time. </li></ul>*Object Interaction Diagram
    24. 24. Sequence Diagram <ul><li>A sequence diagram shows an interaction arranged in a time sequence. </li></ul>Telephone Call dialTone( ) : Exchange : Receiver : Caller offHook( ) ringTone( ) dialNumber( ) : Talk offHook( ) onHook( ) breakConnection( ) onHook( )
    25. 25. Collaboration Diagram <ul><li>A collaboration diagram shows process interactions and messaging. </li></ul>ATM Machine:Definition Checking Account Account Bank Client 5: Process Transaction 8: Transaction succeed 4: Enter Amount 13: Terminate 1: Request Kind 2: Enter Kind 3: Request Amount 9: Dispense Cash 10: Request Take Cash 11: Take Cash 12: Request Continuation 14: Print Receipt 7: Withdraw Successful 6: Withdraw Checking Account
    26. 26. UML Statechart Diagram <ul><li>A UML statechart diagram shows the change in states that an object encounters during its life as it responds to outside stimuli and messages. </li></ul><ul><li>Statecharts are good for showing complex state behavior of some objects. </li></ul><ul><li>Statecharts are often seen in real-time or embedded system modeling. User Interface navigation can employ statecharts. </li></ul>
    27. 27. Idle lift receiver and get dial tone Idle State Dialing Substates Dialing Start Dial entry and start dialog exit / stop dial tone entry and num.append(n) digit(n) num.isValid( )
    28. 28. UML Activity Diagram <ul><li>An activity diagram is a variation or special case of a state machine. </li></ul><ul><li>The states are activities representing the performance of operations. </li></ul><ul><li>The transitions are triggered by the completion of the operations. </li></ul><ul><li>Activity diagrams are easily confused with traditional flow charts but can show synchronous events. </li></ul>
    29. 29. Activity Diagram with Swimlanes Office Clerk Insurance Agent Loan Officer Edit Incoming Paper Complete Request Check Life insurance Draw Up Deed Calculate Mortgage Pay Provision to Agent Write Insurance Policy Index documents
    30. 30. Component diagrams User Interface Update Access <ul><li>Packages the logical view. Component diagrams show the structure (libraries) of the code itself. </li></ul>
    31. 31. Deployment Diagram <ul><li>Packages the implementation view. Deployment diagrams show the structure (hardware) of the run-time system. </li></ul>
    32. 32. A Package and Its Contents <ul><li>Used for model management, a package is a grouping of model elements and may contain other packages. </li></ul>GradeBook Student class Class grade exam lab Year semester * * * student GradeNoteBook
    33. 33. Notes in UML <ul><li>A note is a graphic symbol containing textual information that might be anchored. </li></ul><ul><li>It also could contain embedded images. </li></ul>Represents an incorporated entity Person Company employee employer Static models & revision levels released yesterday
    34. 34. Recap: The UML Diagrams <ul><li>Use-case diagram </li></ul>Requirements Behavioral view (dynamic) <ul><li>Sequence diagram (an OID) </li></ul><ul><li>Collaboration diagram (an OID) </li></ul><ul><li>State Chart diagram </li></ul><ul><li>Activity diagram </li></ul>Implementation view <ul><li>Component diagram </li></ul><ul><li>Deployment diagram </li></ul>Organizing the Model <ul><li>Package </li></ul>Static view <ul><li>Class diagram </li></ul><ul><li>Object diagram </li></ul>
    35. 35. Recap: The UML Diagrams <ul><li>Use-case diagram </li></ul>Requirements Behavioral view (dynamic) <ul><li>Sequence diagram (an OID) </li></ul><ul><li>Collaboration diagram (an OID) </li></ul><ul><li>State Chart diagram </li></ul><ul><li>Activity diagram </li></ul>Implementation view <ul><li>Component diagram </li></ul><ul><li>Deployment diagram </li></ul>Organize Models <ul><li>Package </li></ul><ul><li>Object diagram </li></ul>Static view <ul><li>Class diagram </li></ul>Class Instances Model
    36. 36. Diagrams in View Context Structural View Implementation View User View Behavioral View Environment View Class Diagrams Object Diagrams Sequence Diagrams Collaboration Diagrams Statechart Diagrams Activity Diagrams Component Diagrams Deployment Diagrams Use Case Diagrams
    37. 37. A Very Few Resources <ul><li>Books (UML only) </li></ul><ul><li>Page-Jones, Meilir (2000). Fundamentals of Object-Oriented Design in UML . Addison-Wesley. </li></ul><ul><li>Taylor, David (1992). Object-Oriented Technology; A Manager's Guide. Addison-Wesley. </li></ul><ul><li>Web Sites </li></ul><ul><li>IBM / Rational Software. UML resource center . </li></ul><ul><li>The Object Mangement Group. UML resource page . </li></ul>
    38. 38. Typical UML Models/Diagrams <ul><li>Class Diagram - Describes the logical structure of the architecture by showing the types of classes that constitute the system and their interrelationships. A class represents a set of logical objects that share the same attributes and behavior. </li></ul><ul><li>Use Case Diagram – Describes the required functionality of the system in terms of goals that provide an observable result of value or service to actors. </li></ul><ul><li>Activity Diagram – Describes, in a workflow format, the activities and decisions required by a system to achieve the goal of an associated use case. </li></ul><ul><li>Statechart Diagram - Describes the states of a system across the system’s lifecycle (may show the affects of several use cases). It shows the transition from state to state in response to an event. </li></ul><ul><li>Sequence Diagram – Describes how the sequences of activities are controlled by the objects’ interactions. In particular, they show the objects participating in the interaction and the time sequence of messages exchanged. </li></ul>The SoSE modeling suite will be used by the System Architecture Team to capture the system requirements and architecture for system development.
    39. 39. Class Diagram Format actor class interface relationship system class boundary system class System Class: An abstract representation of the SoS, System, Subsystem or Configuration Item (e.g., a class of ship, airplane, truck, satellite, HWCI, or CSCI). Actor Class: An abstract role represented by an individual or a group of individuals, organizations, or external systems that interact with the system class. system class
    40. 40. Actor and Use Case Format actor class value or service relationship use case system boundary Use Case Name should be a statement of the goal (or service) desired by the actor expressed as an active verb and a quantifiable noun (e.g., start engines and maneuver satellite).
    41. 41. Use Case Diagram Example Regional Commander
    42. 42. Activity Diagram Format activity stop actor action classes activity flow path start swim lanes
    43. 43. Activity Diagram Example for Monitor Area Use Case : Regional Commander : Mobil Command Center (MCC) : AWACS
    44. 44. State Chart Diagram Format start state transition stop transition transition state
    45. 45. State Chart Diagram Example Startup Surveillance Planning Engagement Sensors Tasked Target Reported Course of Action Determined Target Report Mission Completed Mission Initiated
    46. 46. Sequence Diagram Format Interactions actor initiates action classes actor receives response
    47. 47. Sequence Diagram Example
    48. 48. Collaboration Diagrams Format actor initiates action actor receives response interactions
    49. 49. Collaboration Diagram Example : Regional Commander