Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

Similar presentations


Presentation on theme: "1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling."— Presentation transcript:

1 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling

2 2 Objectives  Describe the importance of visual modeling.  Define the four principles of visual modeling.  Explain what the Unified Modeling Language (UML) represents.

3 3 Where Are We?  What is modeling?  Four principles of visual modeling  The UML

4 4 What Is a Model?  A model is a simplification of reality.

5 5 Why Model?  Modeling achieves four aims:  Helps you to visualize a system as you want it to be.  Permits you to specify the structure or behavior of a system.  Gives you a template that guides you in constructing a system.  Documents the decisions you have made.  You build models of complex systems because you cannot comprehend such a system in its entirety.  You build models to better understand the system you are developing.

6 6  What is modeling?  Four principles of visual modeling  The UML Where Are We?

7 7 Four Principles of Modeling  The model you create influences how the problem is attacked.  Every model may be expressed at different levels of precision.  The best models are connected to reality.  No single model is sufficient.

8 8 Design ModelProcess Model Principle 1: The Choice of Model is Important  The models you create profoundly influence how a problem is attacked and how a solution is shaped.  In software, the models you choose greatly affect your world view.  Each world view leads to a different kind of system. Deployment Model

9 9 Principle 2: Levels of Precision May Differ  Every model may be expressed at different levels of precision.  The best kinds of models let you choose your degree of detail, depending on: Who is viewing the model. Why they need to view it. View for DesignersView for Customers

10 10 Principle 3: The Best Models Are Connected to Reality  All models simplify reality.  A good model reflects potentially fatal characteristics.

11 11 Principle 4: No Single Model Is Sufficient  No single model is sufficient. Every non-trivial system is best approached through a small set of nearly independent models.  Create models that can be built and studied separately, but are still interrelated. Process ViewDeployment View Logical View Use-Case View Implementation View End-user Functionality Programmers Software management Performance, scalability, throughput System integrators System topology, delivery, installation, communication System engineering Analysts/Designers Structure

12 12  What is modeling?  Four principles of visual modeling  The UML Where Are We?

13 13 What Is the UML?  The UML is a language for Visualizing Specifying Constructing Documenting the artifacts of a software-intensive system.

14 14 The UML Is a Language for Visualizing  Communicating conceptual models to others is prone to error unless everyone involved speaks the same language.  There are things about a software system you can’t understand unless you build models.  An explicit model facilitates communication.

15 15 The UML Is a Language for Specifying  The UML builds models that are precise, unambiguous, and complete.

16 16 The UML Is a Language for Constructing  UML models can be directly connected to a variety of programming languages.  Maps to Java, C++, Visual Basic, and so on  Tables in a RDBMS or persistent store in an OODBMS  Permits forward engineering  Permits reverse engineering

17 17 The UML Is a Language for Documenting Use Case Diagram Actor A Use Case 1 Use Case 2 Use Case 3 Actor B Class Diagram Sequence Diagram user mainWndfileMgr : FileMgr repositorydocument : Document gFile 1: Doc view request ( ) 2: fetchDoc( ) 3: create ( ) 4: create ( ) 5: readDoc ( ) 6: fillDocument ( ) 7: readFile ( ) 8: fillFile ( ) 9: sortByName ( ) ƯÁ¤¹®¼­¿¡ ´ëÇÑ º¸±â¸¦ »ç¿ëÀÚ°¡ ¿äûÇÑ´Ù. È­ÀÏ°ü¸®ÀÚ´Â Àоî¿Â ¹®¼­ÀÇ Á¤º¸¸¦ ÇØ´ç ¹®¼­ °´Ã¼¿¡ ¼³Á¤À» ¿äûÇÑ´Ù. È­¸é °´Ã¼´Â ÀоîµéÀÎ °´Ã¼µé¿¡ ´ëÇØ À̸§º°·Î Á¤·ÄÀ» ½ÃÄÑ È­¸é¿¡ º¸¿©ÁØ´Ù.  The UML addresses documentation of system architecture, requirements, tests, project planning, and release management. Deployment Diagram Window95 ¹®¼­°ü¸® Ŭ¶óÀ̾ðÆ®.EXE Windows NT ¹®¼­°ü¸® ¿£Áø.EXE Windows NT Windows95 Solaris ÀÀ¿ë¼­¹ö.EXE Alpha UNIX IBM Mainframe µ¥ÀÌŸº£À̽º¼­¹ö Windows95 ¹®¼­°ü¸® ¾ÖÇø´ ºÐ»ê ȯ°æÀÇ Çϵå¿þ¾î¹× ³×Æ®¿÷À¸·ÎÀÇ Á¤º¸ ½Ã½ºÅÛ ¿¬°á ¸ðµ¨ - À©µµ¿ì 95 : Ŭ¶óÀ̾ðÆ® - À©µµ¿ì NT: ÀÀ¿ë¼­¹ö - À¯´Ð½º ¸Ó½Å: ÀÀ¿ë ¼­¹ö ¹× µ¥ÀÌŸ ¼­¹ö, Åë½Å ¼­¹ö - IBM ¸ÞÀÎÇÁ·¹ÀÓ: µ¥ÀÌŸ ¼­¹ö, Åë½Å ¼­¹ö

18 18 History of the UML UML Partners’ Expertise UML 1.0 (Jan. ‘97) UML 1.1 (Sept. ‘97) UML 1.5 (March, ‘03) UML 2.0 (2004) Other Methods Booch ‘91OMT - 1OOSE Booch ’93OMT - 2 Public Feedback Unified Method 0.8 (OOPSLA ’95) UML 0.9 (June ‘96) UML 0.91 (Oct. ‘96) and

19 19 Inputs to the UML Fusion Operation descriptions, message numbering Before and after conditions Meyer Harel State charts Wirfs-Brock Responsibilities Embley Singleton classes, High-level view Odell ClassificationObject lifecycles Shlaer- Mellor Gamma, et.al Frameworks, patterns, notes BoochRumbaughJacobson Selic, Gullekson, Ward ROOM (Real-Time Object-Oriented Modeling)

20 20 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Class Diagrams

21 21 Objectives  Describe the static view of the system and show how to capture it in a model.  Demonstrate how to read and interpret a class diagram.  Model an association and aggregation and show how to model it in a class diagram.  Model generalization on a class diagram.

22 22 Where Are We?  Class diagrams  Class relationships  Association  Aggregation  Generalization

23 23 What Is a Class Diagram?  Static view of a system CloseRegistrationForm + open() + close registration() Student + get tuition() + add schedule() + get schedule() + delete schedule() + has pre-requisites() Schedule - semester + commit() + select alternate() + remove offering() + level() + cancel() + get cost() + delete() + submit() + save() + any conflicts?() + create with offerings() + update with new selections() Professor - name - employeeID : UniqueId - hireDate - status - discipline - maxLoad + submitFinalGrade() + acceptCourseOffering() + setMaxLoad() + takeSabbatical() + teachClass() CloseRegistrationController + is registration open?() + close registration()

24 24 Class Diagram Usage  When modeling the static view of a system, class diagrams are typically used in one of three ways, to model:  The vocabulary of a system  Collaborations  A logical database schema

25 25 Example: Class Diagram  Is there a better way to organize class diagrams? CloseRegistrationForm LoginForm Professor BillingSystem CloseRegistrationController RegisterForCoursesForm Course CourseCatalogSystem Student RegistrationController CourseOffering Schedule

26 26  A general purpose mechanism for organizing elements into groups.  A model element that can contain other model elements.  A package can be used:  To organize the model under development  As a unit of configuration management Review: What Is a Package? University Artifacts

27 27 Example: Registration Package Registration CloseRegistrationForm CloseRegistrationController RegisterForCoursesFormRegistrationController

28 28  Class diagrams  Class relationships  Association  Aggregation  Generalization Where Are We?

29 29 What Is an Association?  The semantic relationship between two or more classifiers that specifies connections among their instances.  A structural relationship specifying that objects of one thing are connected to objects of another thing. CourseStudentSchedule

30 30 Example: What Associations Can You Find? : CourseOffering : RegistrationController : Schedule : Student : PrimaryScheduleOfferingInfo 8: any conflicts?( ) : RegisterForCoursesForm 2: submit schedule( ) 4: submit( ) 3: save( ) 7: still open?( ) 9: add student(Schedule) 5: is selected?( ) 10: mark as enrolled in( ) 6: has pre-requisites(CourseOffering) 1: submit schedule( ) : Student

31 31 What Is Multiplicity?  Multiplicity is the number of instances one class relates to ONE instance of another class.  For each association, there are two multiplicity decisions to make, one for each end of the association.  For each instance of Professor, many Course Offerings may be taught.  For each instance of Course Offering, there may be either one or zero Professor as the instructor. ProfessorCourseOffering 0..10..*0..10..* instructor

32 32 Multiplicity Indicators 2..4 0..1 1..* 0..* 1 * 2, 4..6 Unspecified Exactly One Zero or More Zero or One ( optional value ) One or More Specified Range Multiple, Disjoint Ranges

33 33 Example: Multiplicity RegisterForCoursesForm CourseOfferingSchedule 0..4 0..* Student 0..* 1 RegistrationController 1 1 1 1 0..1

34 34  Class diagrams  Class relationships  Association  Aggregation  Generalization Where Are We?

35 35 What Is an Aggregation?  A special form of association that models a whole-part relationship between the aggregate (the whole) and its parts.  An aggregation is an “is a part-of” relationship.  Multiplicity is represented like other associations. Part Whole 0..1 1

36 36 Example: Aggregation RegisterForCoursesForm CourseOfferingSchedule 0..4 0..* Student 0..* 1 RegistrationController 1 1 1 1 0..1

37 37  Class diagrams  Class relationships  Association  Aggregation  Generalization Where Are We?

38 38 Review: What Is Generalization?  A relationship among classes where one class shares the structure and/or behavior of one or more classes.  Defines a hierarchy of abstractions where a subclass inherits from one or more superclasses.  Single inheritance  Multiple inheritance  Is an “is a kind of” relationship.

39 39 Example: Single Inheritance  One class inherits from another. CheckingSavings Superclass (parent) Subclasses (children) Generalization Relationship Descendents Ancestor Account - balance - name - number + withdraw() + createStatement()

40 40 Example: Multiple Inheritance  A class can inherit from several other classes. Use multiple inheritance only when needed and always with caution! FlyingThingAnimal HorseWolfBirdHelicopterAirplane Multiple Inheritance

41 41 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Interaction Diagrams

42 42 Objectives  Describe dynamic behavior and show how to capture it in a model.  Demonstrate how to read and interpret:  A sequence diagram  A communication diagram  Explain the similarities and differences between communication and sequence diagrams.

43 43 Objects Need to Collaborate  Objects are useless unless they can collaborate to solve a problem.  Each object is responsible for its own behavior and status.  No one object can carry out every responsibility on its own.  How do objects interact with each other?  They interact through messages.

44 44 Objects Interact with Messages  A message shows how one object asks another object to perform some activity. : Car buyer :RegistrationController:CourseCatalogSystem getCourseOfferings(forSemester) Message

45 45 What is an Interaction Diagram?  Generic term that applies to several diagrams that emphasize object interactions  Sequence Diagram  Communication Diagram  Specialized Variants  Timing Diagram  Interaction Overview Diagram

46 46 Interaction Diagrams  Sequence Diagram  Time oriented view of object interaction  Communication Diagram  Structural view of messaging objects Communication Diagrams Sequence Diagrams

47 47 Interaction Diagrams  Timing Diagram  Time constraint view of messages involved in an interaction  Interaction Overview Diagram  High level view of interaction sets combined into logic sequence Timing Diagrams Interaction Overview Diagrams

48 48  Sequence diagrams  Communication diagrams  Interaction diagram comparison Where Are We?

49 49 What Is a Sequence Diagram?  A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.  The diagram shows:  The objects participating in the interaction.  The sequence of messages exchanged. Sequence Diagram

50 50 Example: Sequence Diagram : Student :RegisterForCoursesForm :RegistrationController : Course Catalog :CourseCatalogSystem 1: create schedule( ) 5: display course offerings( ) 2: get course offerings( ) 3: get course offerings(forSemester) 6: display blank schedule( ) 4: get course offerings( ) Select Offerings ref

51 51 Sequence Diagram Contents: Objects :RegisterForCoursesForm:RegistrationControllerSWTSU Catalog : CourseCatalogSystem Anonymous Objects Lifelines Named Object

52 52 :RegisterForCoursesForm:RegistrationControllerSWTSU Catalog : CourseCatalogSystem : Student : Course Catalog Sequence Diagram Contents: Actor Actor instances

53 53 Sequence Diagram Contents: Messages Reflexive Messages 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(for Semester) 4: get course offerings( ) :RegisterForCoursesForm:RegistrationControllerSWTSU Catalog : CourseCatalogSystem : Student : Course Catalog 6: display blank schedule( ) 5: display course offerings( ) Message

54 54 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(for Semester) 4: get course offerings( ) 6: display blank schedule( ) :RegisterForCoursesForm:RegistrationControllerSWTSU Catalog : CourseCatalogSystem : Student : Course Catalog Sequence Diagram Contents: Execution Occurrence Execution Occurrence 5: display course offerings( )

55 55 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(for Semester) 4: get course offerings( ) 6: display blank schedule( ) :RegisterForCoursesForm:RegistrationControllerSWTSU Catalog : CourseCatalogSystem : Student : Course Catalog Sequence Diagram Contents: Event Occurrence Event Occurrence 5: display course offerings( )

56 56 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(for Semester) 4: get course offerings( ) 6: display blank schedule( ) :RegisterForCoursesForm:RegistrationControllerSWTSU Catalog : CourseCatalogSystem : Student : Course Catalog Sequence Diagram Contents: Interaction Occurrence 5: display course offerings( ) Select Offerings ref Interaction Occurrence

57 57  Sequence diagrams  Communication diagrams  Interaction diagram comparison Where Are We?

58 58 What Is a Communication Diagram?  A communication diagram emphasizes the organization of the objects that participate in an interaction.  The communication diagram shows:  The objects participating in the interaction.  Links between the objects.  Messages passed between the objects. Communication Diagrams

59 59 Example: Communication Diagram : Student : RegisterForCoursesForm : RegistrationController : CourseCatalogSystem 5: display course offerings( ) 6: display blank schedule( ) : Course Catalog 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(forSemester) 4: get course offerings( )

60 60 Communication Diagrams Contents: Objects Objects : RegisterForCoursesForm : RegistrationController SWTSU Catalog : CourseCatalogSystem

61 61 Communication Diagram Contents: Actors : Student : Course Catalog : RegisterForCoursesForm : RegistrationControllerSWTSU Catalog : CourseCatalogSystem Actors

62 62 Communication Diagram Contents: Links and Messages : Student : RegisterForCoursesForm : RegistrationController : CourseCatalogSystem 5: display course offerings( ) 6: display blank schedule( ) : Course Catalog 1: create schedule( ) 2: get course offerings( ) 3: get course offerings(forSemester) 4: get course offerings( ) Links Messages

63 63  Sequence diagrams  Communication diagrams  Interaction diagram comparison Where Are We?

64 64 Sequence and Communication Diagram Similarities  Semantically equivalent  Can convert one diagram to the other without losing any information  Model the dynamic aspects of a system  Model a use-case scenario

65 65 Sequence and Communication Diagram Differences Sequence diagrams Communication diagrams  Show the explicit sequence of messages  Show execution occurrence  Better for visualizing overall flow  Better for real-time specifications and for complex scenarios  Show relationships in addition to interactions  Better for visualizing patterns of communication  Better for visualizing all of the effects on a given object  Easier to use for brainstorming sessions

66 66 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Other UML Diagrams

67 67 Objectives  Demonstrate how to read and interpret a:  State machine diagram  Component diagram  Deployment diagram

68 68 Where Are We?  State machine diagrams  Component diagrams  Deployment diagrams

69 69 Review: An Object Has State  State is a condition or situation during the life of an object, which satisfies some condition, performs some activity, or waits for some event.  The state of an object normally changes over time. Name: J Clark Employee ID: 567138 Date Hired: July 25, 1991 Status: Tenured Discipline: Finance Maximum Course Load: 3 classes Name: J Clark Employee ID: 567138 HireDate: 07/25/1991 Status: Tenured Discipline: Finance MaxLoad: 3 Professor Clark

70 70 Example: Professor  There are a sequence of events before an instructor becomes a University professor.  Assistant professor (achieves tenure by producing a number of quality publications)  Tenure/Associate professor  Professor (based on seniority)

71 71 What Are State Machine Diagrams?  A state machine diagram models dynamic behavior.  It specifies the sequence of states in which an object can exist:  The events and conditions that cause the object to reach those states  The actions that take place when those states are reached Assistant Professor Tenured

72 72 Special States  The initial state is the state entered when an object is created.  An initial state is mandatory.  Only one initial state is permitted.  The initial state is represented as a solid circle.  A final state indicates the end of life for an object.  A final state is optional.  A final state is indicated by a bull’s eye.  More than one final state may exist. Applied

73 73 What Are Events?  An event is the specification of a significant occurrence that has a location in time and space.  An event is an occurrence of a stimulus that can trigger a state transition.  Example: Successful publication of numerous papers Tenured Assistant Professor Event

74 74 What Are Transitions?  A transition is a change from an originating state to a successor state as a result of some stimulus.  The successor state could possibly be the originating state.  A transition may take place in response to an event.  Transitions can be labeled with event names. TransitionEvent Name Tenured Assistant Professor maxPapers

75 75 Example: State Machine Hired Assistant Professor Tenured Professor Applied rejected accepted Hiatus HH takeSabbatical retired maxPapers seniority return

76 76 Where Are We?  State machine diagrams  Component diagrams  Deployment diagrams

77 77 What Is a Component Diagram?  A diagram that shows the organizations and dependencies among components ComponentA > ComponentC > ComponentB > ComponentD >

78 78 What Is a Component?  A modular part of a system that hides its implementation behind a set of external interfaces.  Part of a logical or physical system  It conforms to and provides the physical realization of a set of interfaces.  It specifies the physical dependency to interfaces it requires. Provided Interface Name Required Interface Name > Component Name >

79 79 Where Are We?  State machine diagrams  Component diagrams  Deployment diagrams

80 80 What Is a Deployment Diagram?  The deployment diagram shows:  Configuration of processing nodes at run-time  Communication links between these nodes  Deployed artifacts that reside on them

81 81 What Is a Node?  Represents a run-time computational resource  Generally has at least memory and often processing capability.  Types:  Device Physical computational resource with processing capability. May be nested  Execution Environment Represent particular execution platforms > EE Name > Device Name > Sub Device Name

82 82 What Is a Connector?  A connector represents a:  Communication mechanism Physical medium Software protocol > Server > Connector > Console > Kiosk

83 83 Example: Deployment Diagram > Course Catalog > Registration Server > PC Billing System > 0..2000 1 1 1 1 1

84 84 Example: Deployment Diagram with Processes > Course Catalog > Registration Server > PC Billing System > CourseCatalogSystemAccess CourseRegistrationProcess BillingSstemAccess StudentApplication 0..2000 1 1 1 1 1


Download ppt "1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling."

Similar presentations


Ads by Google