Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Copyright Eliyahu Brutman Programming Techniques Course.

Similar presentations


Presentation on theme: "© Copyright Eliyahu Brutman Programming Techniques Course."— Presentation transcript:

1 © Copyright Eliyahu Brutman Programming Techniques Course

2 © Copyright Eliyahu Brutman Chapter 2 – UML Version 1.0

3 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 3 Table of contents Goals and objectives of UML Models, views and diagrams Use Case Diagram Class Diagram Object Diagram Component Diagram Deployment Diagram Sequence Diagram Collaboration Diagram Activity Diagram Statechart Diagram

4 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 4 What We Have Seen So Far SW Engineering – Waterfall Model, Iterative-Spiral Model, RUP – Rational Unified Process RUP defined for each stage Why software engineering is important, and what are its main characteristics Encapsulation The OO development model, why is it a better model? OO Objectives  Faster “ ramp up ”, easier mapping, unified model for all development process stages, code reuse, easier maintenance, parallel development and de-coupling, flexibility OO Model  Objects, attributes, inter-relationships, operations, message passing, responsibilities, hierarchies, invariant state, behavior

5 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 5 Motivation How to specify a system Text description  OK, but many problems in ambiguity of words Formal methods  OK, but difficult to use Programming languages  OK, but too detailed, difficult to have an overview Graphical display of items and their relationships  YES, but many ways of showing graphical elements A common language within a discipline is essential for the design of complex systems especially with respect to reuse of components

6 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 6 Goals Common method for expressing Requirements Analysis Design Implementation Testing With one methodology With a supporting tool Visual expression Unified Language for Expressing and supporting the entire software development life cycle

7 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 7 Objectives The UML is a language for visualizing specifying constructing documenting the artifacts of a software-intensive system

8 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 8 Advantages UML allows the specification of complex systems in particular, software systems in particular, object-oriented programming languages UML is based on visual descriptions of system aspects easy to use and understand language independent independent of specific development methods and tools Supported by many companies and organizations one of the widely-used evolving into an industry standard for software engineering [Kearns 00]

9 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 9 UML Building Blocks Model elements classes, interfaces, components, use cases, … Relationships associations, generalizations, dependencies, … Diagrams for use cases, classes, objects, behaviors, implementation and environment aspects

10 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 10 Architectural Views and Diagrams User model view relies on use case diagrams to describe the problem and its solution from the perspective of the product end user Structural model view describes static aspects of the system through class diagram and object diagram implementation model view  focuses on the implementation of a solution, and shows the organization of solution components in component diagram environment model view  shows the configuration of elements in the environment, and indicates the mapping of solution components to those elements through deployment diagram Behavioral model view describes dynamic aspects of the system through sequence diagram, collaboration diagram, state diagram, and activity diagram

11 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 11 Use Case Model Describes the system from the user ’ s perspective Packages the most relevant activities in use cases Identifies important actors Do not describe the details of how the system interacts with the user

12 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 12 Use Case Diagram Online C2C shopping overview the usage requirements presentations project stakeholders "the meat" of the actual requirements Actor Actor: An actor is a person, organization, or external system that plays a role in one or more interactions with your system Use case Use case: A use case describes a sequence of actions that provide something of measurable value to an actor and is drawn as a horizontal ellipse System boundary System boundary: indicates the scope of your system. Anything within the box represents functionality that is in scope and anything outside the box is not

13 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 13 Use Case Diagram Captures system functionality as seen by users An actor is someone or something outside the system that interacts with the system A use case is a sequence of actions a system performs that yields an observable result of value to a particular actor

14 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 14 Structural Model Identifies the static structure of the system system architecture Emphasizes classes and objects through class and object diagrams, Shows the implementation aspects through component and deployment diagrams

15 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 15 Class Diagram Describe the static structure of a system. Classes Visibility Associations Multiplicity (Cardinality) Constraint Other relationships  Composition  Aggregation  Generalization

16 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 16 Class Diagram Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and attributes of the classes. Name Attributes Operations Relations Associations Aggregation Generalization

17 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 17 Relationships between Class Diagrams Association -- a relationship between instances of the two classes. There is an association between two classes if an instance of one class must know about the other in order to perform its work. In a diagram, an association is a link connecting two classes. Aggregation -- an association in which one class belongs to a collection. An aggregation has a diamond end pointing to the part containing the whole. Generalization -- an inheritance link indicating one class is a superclass of the other. A generalization has a triangle pointing to the superclass.

18 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 18 Class Diagram

19 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 19 Object Diagram Captures specific instances and links between them

20 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 20 Object Diagram

21 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 21 Component Diagram A component diagram describes the structural relationships between the components of a system

22 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 22 Component Example [Kobryn 00]

23 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 23 Component Diagram

24 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 24 Deployment Diagram Depicts the physical resources in a system including nodes, components, network connections and resources and others Purpose Specify the distribution of components Identify performance bottlenecks

25 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 25 Deployment Diagram

26 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 26 Behavioral Model Capture dynamic interaction among classes and actors Reflect messages and time. Show the interactions between instances of objects in the model graph of instances and stimuli existing instances creation and deletion Sequence diagram has a temporal focus what happens when? Collaboration diagram has a structural focus who interacts with whom?

27 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 27 Example Interaction Diagrams xyz Sequence Diagram a b c Collaboration Diagram xy z 1.1: a 1.2: c 1.1.1: b

28 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 28 Sequence Diagram A sequence diagram is An interaction diagram that details how operations are carried out. What messages are sent and when. Sequence diagrams are organized according to time Object: Class Lifeline Operations Message

29 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 29 Sequence Diagram

30 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 30 Activity Diagram Flow of control among activities, dynamic view Activity represents an operation of a class, resulting is system state change Click to View Full Size

31 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 31 Activity Diagram Activity diagrams describe the workflow behaviour of a system Start Fork Branch Merge Joint End

32 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 32 Activity Diagram

33 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 33 When to Use Activity Diagrams Use activity diagrams when the behavior you are modeling does not depend much on external events mostly has steps that run to completion, rather than being interrupted by events requires object/data flow between steps is being constructed at a stage when you are more concerned with which activities happen, rather than which objects are responsible for them

34 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 34 Statechart Diagram Captures dynamic behavior (event-oriented) Model object lifecycle Click to View Full Size

35 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 35 Statechart Diagram

36 © Copyright Eliyahu Brutman Programming Techniques – Chapter 2 - 36 Statechart Diagram


Download ppt "© Copyright Eliyahu Brutman Programming Techniques Course."

Similar presentations


Ads by Google