Uml - An Overview

20,607 views

Published on

This will give you an overview of UML for those new to UML.
Version is UML 1.4

Published in: Technology, Business
23 Comments
97 Likes
Statistics
Notes
No Downloads
Views
Total views
20,607
On SlideShare
0
From Embeds
0
Number of Embeds
360
Actions
Shares
0
Downloads
1,648
Comments
23
Likes
97
Embeds 0
No embeds

No notes for slide

Uml - An Overview

  1. 1. - U nified M odeling L anguage Rajthilak S
  2. 2. Many Stakeholders , many views <ul><li>Architecture may be many things to many different stakeholders </li></ul><ul><ul><ul><li>End user </li></ul></ul></ul><ul><ul><ul><li>Project Manager </li></ul></ul></ul><ul><ul><ul><li>System Engineer </li></ul></ul></ul><ul><ul><ul><li>Developer </li></ul></ul></ul><ul><ul><ul><li>Tester </li></ul></ul></ul><ul><ul><ul><li>Maintainer </li></ul></ul></ul><ul><li>Multidimensional Reality </li></ul><ul><li>Many Stakeholders </li></ul><ul><li>multiple views , multiple blueprints </li></ul>
  3. 3. Models <ul><li>Modeling is the designing of software applications before coding. </li></ul><ul><li>Models are the higher level of abstraction of the System. </li></ul><ul><li>A model plays the analogous role in software development that blueprints and other plans (site maps, elevations, physical models) play in the building of a skyscraper. </li></ul><ul><li>Modeling is the only way to visualize the design and check it against requirements before one starts to code.  </li></ul><ul><li>Models are also the vehicle for communication with various stake holders. </li></ul>
  4. 4. What is UML? <ul><li>General-purpose modeling language </li></ul><ul><li>Helps to specify, visualize, and document models of software systems </li></ul><ul><li>High Level abstraction of the system </li></ul><ul><li>Represents the system using Graphical Notations from various Perspectives </li></ul><ul><li>used for business modeling and modeling of other non-software systems too </li></ul><ul><li>UML 2.0 </li></ul>
  5. 5. Evolution of UML <ul><li>Successor to the wave of Object Oriented Analysis and Design(OOA&D). </li></ul><ul><li>unifies the notations used by three amigos(Grady Booch, Ivar Jacobson and James Rumbaugh) in their OO methods. </li></ul><ul><li>OMG </li></ul>
  6. 6. Different Perspectives of System
  7. 7. Basic OO Terms <ul><li>A model is an abstraction of the underlying problem. </li></ul><ul><li>The domain is the actual world from which the problem comes. </li></ul><ul><li>Models consist of objects that interact by sending each other messages . </li></ul><ul><li>Objects have things they know ( attributes ) and things they can do ( behaviors or operations ). </li></ul><ul><li>The values of an object's attributes determine its state . </li></ul><ul><li>Classes are the &quot;blueprints&quot; for objects. A class wraps attributes (data) and behaviors (methods or functions) into a single distinct entity. Objects are instances of classes. </li></ul>
  8. 8. The Unified Modelling Language – 1.4 <ul><li>Structural Diagrams- class,object,component,deployment diagrams. </li></ul><ul><li>Behavioural Diagrams – Use Case , Activity and State Chart diagrams. </li></ul><ul><li>Interaction Diagrams – Sequence and Collaboration diagrams. </li></ul>Use Case Diagrams Use Case Diagrams Use Case Diagrams Scenario Diagrams Scenario Diagrams Collaboration Diagrams State Diagrams State Diagrams Component Diagrams Component Diagrams Component Diagrams Deployment Diagrams State Diagrams State Diagrams Object Diagrams Scenario Diagrams Scenario Diagrams Statechart Diagrams Use Case Diagrams Use Case Diagrams Sequence Diagrams State Diagrams State Diagrams Class Diagrams Activity Diagrams Models
  9. 9. USE CASE DIAGRAM <ul><li>Outsider's view of a system. </li></ul><ul><li>Emphasizes on what a system does rather than how. </li></ul><ul><li>Use case diagrams are the collection of scenarios. </li></ul><ul><li>A scenario is an example of what happens when someone(Actor) interacts with the system. </li></ul><ul><li>Scenarios together accomplishes a specific goal of the user. </li></ul><ul><li>Every use case diagram has actors, use cases, and communications. </li></ul>
  10. 10. Use Case Modeling: Core Elements Introduction to UML
  11. 11. Use Case Modeling: Core Relationships Introduction to UML << extend >>
  12. 12. Use Case Modeling: Core Relationships (cont’d) Introduction to UML << include >>
  13. 13. Use Case Relationship
  14. 14. Extend and Include Relationship <ul><li>we can add extend relationships to a model to show the following situations: </li></ul><ul><ul><li>A part of a use case that is optional system behavior </li></ul></ul><ul><ul><li>A subflow is executed only under certain conditions </li></ul></ul><ul><ul><li>A set of behavior segments that may be inserted in a base use case </li></ul></ul><ul><li>Include Relationship </li></ul><ul><ul><li>The behavior of the inclusion use case is common to two or more use cases. </li></ul></ul><ul><ul><li>The result of the behavior that the inclusion use case specifies, not the behavior itself, is important to the base use case. </li></ul></ul>
  15. 15. Example :Use Case Diagram Introduction to UML
  16. 16. USE CASE DIAGRAM <ul><li>Use case diagrams are helpful in three areas. </li></ul><ul><li>determining features (requirements) . </li></ul><ul><li>New use cases often generate new requirements as the system is analyzed and the design takes shape. </li></ul><ul><li>communicating with clients . </li></ul><ul><li>Their notational simplicity makes use case diagrams a good way for developers to communicate with clients. </li></ul><ul><li>generating test cases . </li></ul><ul><li>The collection of scenarios for a use case may suggest a suite of test cases for those scenarios. </li></ul>
  17. 17. CLASS DIAGRAM <ul><li>Structural overview of a system by showing its classes and the relationships among them </li></ul><ul><li>Static diagrams </li></ul><ul><li>Static relations: </li></ul><ul><ul><ul><ul><li>Associations </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Subtypes </li></ul></ul></ul></ul><ul><li>Static structure: </li></ul><ul><ul><ul><ul><li>Attributes </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Operations </li></ul></ul></ul></ul><ul><li>Created along with use case diagrams </li></ul><ul><li>Transition from what? to How? </li></ul>
  18. 18. CLASS DIAGRAM- Class <ul><li>The illustration uses the following UML™ conventions. </li></ul><ul><li>Static members are underlined. Instance members are not. </li></ul><ul><li>The operations follow this form: <access specifier> <name> ( <parameter list>) : <return type> </li></ul><ul><li>The parameter list shows each parameter type preceded by a colon. </li></ul><ul><li>Access specifiers appear in front of each member. </li></ul>
  19. 19. CLASS DIAGRAM <ul><li>Class information: visibility and scope </li></ul><ul><ul><li>Attributes and operations can be labeled according to access and scope </li></ul></ul>Symbol Access + public - private # protected
  20. 20. Class Operations <ul><li>An operation is the implementation of a service that can be requested from any object of the class in order to affect behaviour. </li></ul><ul><li>Used to manipulate the attributes or to perform other actions. </li></ul><ul><li>Operations are normally called functions, but they are inside a class and can be applied only to objects of that class. </li></ul><ul><li>Signature - return-type, a name and zero or more parameters. </li></ul><ul><li>The signature describes everything needed to use the operation. </li></ul>
  21. 21. Example : Class Diagram
  22. 22. Class-Association <ul><li>Associations are structural relationships where instances (objects) of one class are connected to instances (objects) of another class. </li></ul><ul><ul><li>an employee works for a company </li></ul></ul><ul><ul><li>a company has a number of offices </li></ul></ul><ul><li>An association is normally bidirectional, which means that if an object is associated with another object, both objects are aware of each other (navigation is bidirectional by default). </li></ul><ul><li>Binary association connects exactly two classes. </li></ul><ul><li>The most common association is just a connection between classes. </li></ul>
  23. 23. Association adornments: name, role <ul><li>The association has a name - the descriptive term, often a verb, for the association. </li></ul><ul><li>Each association has two association ends ; each end is attached to one of the classes in the association. An end can be explicitly named with a label. This label is called a role name (association ends are often called roles). </li></ul>
  24. 24. Reflexive Associations <ul><li>A class has an association to itself. </li></ul><ul><ul><li>Example: A directory may contain other directories. </li></ul></ul>Directory File 0..1 parent subdirectory 0..* <ul><li>0..* </li></ul>
  25. 25. Class Navigability <ul><li>A navigability arrow on an association shows which direction the association can be traversed or queried. </li></ul>
  26. 26. Class Associations: multiplicity <ul><li>Multiplicity defines the number of objects associated with an instance of the association. </li></ul><ul><ul><li>Default of 1 (1: 1) </li></ul></ul><ul><ul><li>0 or 1: 0..1 </li></ul></ul><ul><ul><li>Zero or more (0..infinite): * </li></ul></ul><ul><ul><li>1 or more (1..infinite): 1..* </li></ul></ul><ul><ul><li>n..m; range from n to m inclusive </li></ul></ul>Car Person transports passenger Car Person transports passenger 5 Car Person transports passenger * Car Person transports passenger 1..* Car Person transports passenger 2..5
  27. 27. Class - Generalization <ul><li>A specialization / generalization relationship, in which objects of the specialized element (child) are substitutable for objects of the generalized element (parent). </li></ul><ul><ul><li>Superclass – the generalization of another class, the child. </li></ul></ul><ul><ul><li>Subclass – the specialization of another class, the parent. </li></ul></ul>
  28. 28. Generalization - characteristics <ul><li>Identify common features concerning behaviour and knowledge. Define these common features on a higher level in the inheritance hierarchy. </li></ul><ul><li>The aim is at behaviour more than knowledge when combining classes. </li></ul><ul><li>Generalization is a bottom-up process. </li></ul><ul><li>A superclass includes all common properties of its subclasses. </li></ul>
  29. 29. Specialization - characteristics <ul><li>Define a new class which is a special appearance of an existing class. </li></ul><ul><li>Specialization is a top-down process. </li></ul><ul><li>A subclass can have attributes and operations that are specific for that sub-class. </li></ul><ul><li>A subclass may redefine operations of its super-class </li></ul>
  30. 30. Class Diagram - Constraints <ul><li>The basic constructs of association, attribute, and generalization do much to specify important constraints. </li></ul><ul><li>They cannot indicate every constraint. These constraints still need to be captured; the class diagram is a good place to do that. </li></ul><ul><li>The UML allows you to use anything to describe constraints. The only rule is that we put them inside braces { }. </li></ul>
  31. 31. CONSTRAINTS
  32. 32. Aggregation and Composition <ul><ul><li>Associations in which an object is part of a whole are aggregations. </li></ul></ul><ul><ul><li>Composition is a strong association in which the part can belong to only one whole -- the part cannot exist without the whole. Composition is denoted by a filled diamond at the whole end. </li></ul></ul>
  33. 33. Aggregation and Composition
  34. 34. Alternative Notation for Composition
  35. 35. Advanced Class Concepts : Abstract <ul><li>An operation is abstract if it has no implementation. </li></ul><ul><li>A abstract class cannot have any direct instances. </li></ul><ul><li>Abstract classes only occur in the context of an inheritance hierarchy. </li></ul><ul><li>Abstract operations and classes are specified by writing its name in italics. </li></ul>
  36. 36. Advanced Class Concepts : Abstract cont.
  37. 37. Class Diagram with Interfaces
  38. 38. Package Diagram <ul><li>To simplify complex class diagrams, we can group classes into packages . Packages. </li></ul><ul><li>Packages appear as rectangles with small tabs at the top. </li></ul><ul><li>The package name is on the tab or inside the rectangle. </li></ul><ul><li>The dotted arrows are dependencies . </li></ul>
  39. 39. PACKAGE DIAGRAM
  40. 40. Interaction : Sequence Diagram <ul><li>Sequence diagrams and Collaboration diagrams </li></ul><ul><li>Class and object diagrams are static model views. Interaction diagrams are dynamic. They describe how objects collaborate. </li></ul><ul><li>A sequence diagram is an interaction diagram that details how operations are carried out -- what messages are sent and when. </li></ul><ul><li>Sequence diagrams are organized according to time. The time progresses as we go down the page. </li></ul><ul><li>The Sequence diagram lists objects horizontally, and time vertically, and models these messages over time. </li></ul>
  41. 41. Sequence Diagram : Drawing Elements <ul><li>Diagram Header Elements </li></ul><ul><ul><li>Actor Represents an external person or entity that interacts with the system </li></ul></ul><ul><ul><li>Object Represents an object in the system or one of its components </li></ul></ul><ul><ul><li>Unit Represents a subsystem, component, unit, or other logical entity in the system (may or may not be implemented by objects) </li></ul></ul><ul><ul><li>Separator Represents an interface or boundary between subsystems, components or units (e.g., air interface, Internet, network) </li></ul></ul><ul><ul><li>Group Groups related header elements into subsystems or components being modeled and are laid out horizontally at the top of the diagram. </li></ul></ul>
  42. 42. Sequence Diagram Body Elements <ul><li>Message </li></ul><ul><li>Synchronous Message </li></ul><ul><li>Asynchronous Message </li></ul><ul><li>Create Message </li></ul><ul><li>Destroy Message </li></ul><ul><li>Action </li></ul>
  43. 43. Sequence Diagram Body Elements <ul><li>Block(Loop or Conditional) </li></ul><ul><li>Page Break </li></ul><ul><li>Return Message </li></ul><ul><li>Free Note </li></ul><ul><li>Flow Note </li></ul><ul><li>Diagram links </li></ul>
  44. 44. Interaction : Sequence Diagram
  45. 45. Sequence Diagram-Example
  46. 47. SEQUENCE DIAGRAM
  47. 48. Usage of Sequence Diagram <ul><li>Complex interactions between components </li></ul><ul><ul><li>components are being developed in parallel by different teams </li></ul></ul><ul><ul><li>Supporting Robust interface covering multiple scenarios </li></ul></ul><ul><li>Use case elaboration </li></ul><ul><ul><li>can be used to flesh out the details of one or more use cases </li></ul></ul>
  48. 49. COLLABORATION DIAGRAM <ul><li>Type of an interaction diagram. </li></ul><ul><li>Collaborates the static and dynamic relationship </li></ul><ul><li>Focus on Object Roles rather than timing. </li></ul><ul><li>Each message in a collaboration diagram has a sequence number . </li></ul><ul><li>The Collaboration diagram may be used to: </li></ul><ul><ul><li>Describe a specific scenario by depicting the movement of messages between the objects </li></ul></ul><ul><ul><li>Show a spatial organization of objects and their interactions, rather than the sequence of the interactions </li></ul></ul>
  49. 50. COLLABORATION DIAGRAM
  50. 51. Sequence Diagram Reserving a copy of book in Library
  51. 52. Collaboration Diagram Reserving a copy of book in Library
  52. 53. STATE CHART DIAGRAM <ul><li>Objects have behaviors and state. </li></ul><ul><li>The state of an object depends on its current activity or condition. </li></ul><ul><li>A statechart diagram shows the possible states of the object and the transitions that cause a change in state. </li></ul><ul><li>Our example diagram models the login part of an online banking system. Logging in consists of entering a valid social security number and personal id number, then submitting the information for validation. </li></ul><ul><li>Logging in can be factored into four non-overlapping states: Getting SSN , Getting PIN , Validating , and Rejecting . From each state comes a complete set of transitions that determine the subsequent state. </li></ul>
  53. 54. State Chart Diagram – Dial Tone
  54. 55. STATE CHART DIAGRAM - Login
  55. 56. STATE CHART DIAGRAM <ul><li>States are rounded rectangles. </li></ul><ul><li>Transitions are arrows from one state to another. </li></ul><ul><li>Events or conditions that trigger transitions are written beside the arrows. </li></ul><ul><li>Uses </li></ul><ul><ul><li>The life history of a given class, usecase, operation </li></ul></ul><ul><ul><li>The events that cause a transition from one state to another </li></ul></ul><ul><ul><li>The actions that result from a state change </li></ul></ul>
  56. 57. ACTIVITY DIAGRAM <ul><li>An activity diagram is essentially a fancy flowchart. </li></ul><ul><li>Activity diagrams and statechart diagrams are related. </li></ul><ul><li>Statechart diagram focuses attention on an object undergoing a process (or on a process as an object). </li></ul><ul><li>An activity diagram focuses on the flow of activities involved in a single process. The activity diagram shows the how those activities depend on one another. </li></ul>
  57. 58. Element and its description Symbol Initial Activity: This shows the starting point or first activity of the flow. Activity: Represented by a rectangle with rounded (almost oval) edges. Decisions: Similar to flowcharts. Signal: When an activity sends or receives a message, that activity is called a signal. Signals are of two types: Input signal (Message receiving activity) shown by a concave polygon and Output signal (Message sending activity) shown by a convex polygon. Concurrent Activities: Some activities occur simultaneously or in parallel. Such activities are called concurrent activities. For example, listening to the lecturer and looking at the blackboard is a parallel activity. This is represented by a horizontal split (thick dark line) and the two concurrent activities next to each other, and the horizontal line again to show the end of the parallel activity. Final Activity: The end of the Activity diagram is shown by a bull's eye symbol, also called as a final activity.
  58. 59. ACTIVITY DIAGRAM
  59. 60. Activity Diagram - Example
  60. 61. Implementation diagrams <ul><li>Show aspects of model implementation, including source code structure and run-time implementation structure </li></ul><ul><li>Kinds </li></ul><ul><ul><li>component diagram </li></ul></ul><ul><ul><li>deployment diagram </li></ul></ul>
  61. 62. Component Diagram <ul><li>Shows the organizations and dependencies among software components </li></ul><ul><li>Components include </li></ul><ul><ul><li>source code components </li></ul></ul><ul><ul><li>binary code components </li></ul></ul><ul><ul><li>executable components </li></ul></ul>Introduction to UML
  62. 63. Elements of component diagram Element and its description Symbol Component: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined. Class/Interface/Object: Similar to the notations used in class and object diagrams Realization/Association : Similar to the relation/association used in class diagrams
  63. 64. Component Diagram
  64. 65. Deployment Diagram <ul><li>Shows the configuration of run-time processing elements and the software components, processes and objects that live on them </li></ul><ul><li>Deployment diagrams may be used to show which components may run on which nodes </li></ul>Introduction to UML
  65. 66. Deployment Diagram
  66. 67. The Current Official UML Specification: <ul><li>The current official version of UML and its associated specifications can be </li></ul><ul><li>downloaded from OMG Specifications Catalog page for Modeling and Metadata </li></ul><ul><li>Specifications at </li></ul><ul><li>http://www.omg.org/technology/documents/modeling_spec_catalog.htm#UML </li></ul>
  67. 68. UML Certification <ul><li>OCUP </li></ul><ul><li>OMG Certified UML Professional </li></ul><ul><li>Three Certification Levels: </li></ul><ul><ul><li>OCUP Fundamental </li></ul></ul><ul><ul><li>OCUP Intermediate </li></ul></ul><ul><ul><li>OCUP Advanced </li></ul></ul><ul><ul><li>Link : http://www.omg.org/uml-certification/ </li></ul></ul>
  68. 69. References <ul><li>Web References : </li></ul><ul><ul><li>http://www.uml.org/ </li></ul></ul><ul><ul><li>http://dn.codegear.com/article/31863 </li></ul></ul><ul><ul><li>http://www-128.ibm.com/developerworks/rational/library/3101.html </li></ul></ul><ul><ul><li>http://www.andrew.cmu.edu/course/90-754/umlucdfaq.html </li></ul></ul><ul><li>Book References : </li></ul><ul><ul><li>UML Distilled by Martin Fowler with kendall Scott, Pearson Education. </li></ul></ul><ul><ul><li>User Guide for UML by Grady Booch, Ivar Jacobson and James Rumbaugh </li></ul></ul>
  69. 70. Thank You

×