70
- Unified Modeling Language Rajthilak S Alfonso G B

U nified M odeling L anguage

  • Upload
    landis

  • View
    66

  • Download
    1

Embed Size (px)

DESCRIPTION

U nified M odeling L anguage. - . Rajthilak S Alfonso G B. Contenido. Introducción Tecnología de objetos Modelo de casos de uso Especificación de casos de uso Modelo conceptual Diagramas de clases Diagramas de secuencia. Introducción.System and models. - PowerPoint PPT Presentation

Citation preview

Page 1: U nified  M odeling  L anguage

-

Unified Modeling Language

Rajthilak SAlfonso G B

Page 2: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Contenido

IntroducciónTecnología de objetosModelo de casos de usoEspecificación de casos de usoModelo conceptualDiagramas de clasesDiagramas de secuencia

Page 3: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Introducción. System and models

A System is a objects collection unrelated with a common objective. Modeling is the designing of software applications before coding.

Models are the higher level of abstraction of the System.

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.

Modeling is the only way to visualize the design and check it against requirements before one starts to code. 

Models are also the vehicle for communication with various stake holders.

Page 4: U nified  M odeling  L anguage

GO TO USER ROLES PAGETecnología de objetos. Objects evolution

Successor to the wave of Object Oriented Analysis and Design(OOA&D).

Unifies the notations used by three firends(Grady Booch, Ivar Jacobson and James Rumbaugh) in their OO methods.

Legendary book:

Page 5: U nified  M odeling  L anguage

GO TO USER ROLES PAGETecnología de objetos. Basic OO Terms

A model is an abstraction of the underlying problem.

The domain is the actual world from which the problem comes.

Models consist of objects that interact by sending each other messages.

Objects have things they know (attributes) and things they can do (behaviors or operations).

The values of an object's attributes determine its state.

Classes are the "blueprints" for objects. A class wraps attributes (data) and behaviors (methods or functions) into a single distinct entity. Objects are instances of classes.

Page 6: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Proceso unificado. What is UML?

General-purpose modeling language

Helps to specify, visualize, and document models of software systems

High Level abstraction of the system

Represents the system using Graphical Notations from various Perspectives

used for business modeling and modeling of other non-software systems too

UML 2.0

Page 7: U nified  M odeling  L anguage

GO TO USER ROLES PAGEProceso unificado. Different Perspectives of System

Page 8: U nified  M odeling  L anguage

GO TO USER ROLES PAGEProceso unificado. The Unified Modelling Language – 1.4

Structural Diagrams- class,object,component,deployment diagrams.

Behavioural Diagrams – Use Case , Activity and State Chart diagrams.

Interaction Diagrams – Sequence and Collaboration diagrams.Use CaseDiagramsUse Case

DiagramsUse CaseDiagrams

ScenarioDiagramsScenario

DiagramsCollaborationDiagrams

StateDiagramsState

DiagramsComponentDiagrams

ComponentDiagramsComponent

DiagramsDeploymentDiagrams

StateDiagramsState

DiagramsObjectDiagrams

ScenarioDiagramsScenario

DiagramsStatechartDiagrams

Use CaseDiagramsUse Case

DiagramsSequenceDiagrams

StateDiagramsState

DiagramsClassDiagrams

ActivityDiagrams

Models

Page 9: U nified  M odeling  L anguage

GO TO USER ROLES PAGEModelo de casos de uso. USE CASE DIAGRAM

Outsider's view of a system. Emphasizes on what a system does rather than how. Use case diagrams are the collection of scenarios. A scenario is an example of what happens when

someone(Actor) interacts with the system.

Scenarios together accomplishes a specific goal of the user.

Every use case diagram has actors, use cases, and communications.

Page 10: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Especificación de casos de uso. Core Elements

Introduction to UML

10

Construct Description Syntax use case A sequence of actions, including

variants, that a system (or other entity) can perform, interacting with actors of the system.

actor A coherent set of roles that users of use cases play when interacting with these use cases.

system boundary

Represents the boundary between the physical system and the actors who interact with the physical system.

UseCaseNam e

ActorNam e

Page 11: U nified  M odeling  L anguage

GO TO USER ROLES PAGEEspecificación de casos de uso. Core Relationships

Introduction to UML

11

Construct Description Syntax

association The participation of an actor in a usecase. i.e., instance of an actor andinstances of a use case communicatewith each other.

extend A relationship from an extension usecase to a base use case, specifyinghow the behavior for the extensionuse case can be inserted into thebehavior defined for the base usecase.

generalization A taxonomic relationship between amore general use case and a morespecific use case.

<<extend>>

Page 12: U nified  M odeling  L anguage

GO TO USER ROLES PAGEEspecificación de casos de uso.Core Relationships (cont’d)

Introduction to UML

12

Construct Description Syntax

include An relationship from a base use caseto an inclusion use case, specifyinghow the behavior for the inclusion usecase is inserted into the behaviordefined for the base use case.

<<include>>

Page 13: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Especificación de casos de uso.Use Case Relationship

Page 14: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Especificación de casos de uso.Extend and Include Relationship

we can add extend relationships to a model to show the following situations:

A part of a use case that is optional system behavior A subflow is executed only under certain conditions A set of behavior segments that may be inserted in a base use case

Include Relationship

The behavior of the inclusion use case is common to two or more use cases.

The result of the behavior that the inclusion use case specifies, not the behavior itself, is important to the base use case.

Page 15: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Example :Use Case Diagram

Introduction to UML

15

Page 16: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

En resumen … USE CASE DIAGRAM

Use case diagrams are helpful in three areas.

determining features (requirements). New use cases often generate new requirements as the system is analyzed and the design takes shape.

communicating with clients.Their notational simplicity makes use case diagrams a good way for developers to communicate with clients.

generating test cases. The collection of scenarios for a use case may suggest a suite of test cases for those scenarios.

Page 17: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Definition and types

Structural overview of a system by showing its classes and the relationships among them

Static diagrams Static relations:

Associations Subtypes

Static structure: Attributes Operations

Created along with use case diagrams Transition from what? to How?

Page 18: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. Class

The illustration uses the following UML™ conventions.

• Static members are underlined. Instance members are not.

• The operations follow this form:<access specifier> <name> ( <parameter list>) : <return type>

• The parameter list shows each parameter type

preceded by a colon.

• Access specifiers appear in front of each member.

Page 19: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. Attributes

Class information: visibility and scope

Attributes and operations can be labeled according to access and scope

Symbol Access+ public- private# protected

Page 20: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. Operations

An operation is the implementation of a service that can be requested from any object of the class in order to affect behaviour.

Used to manipulate the attributes or to perform other actions.

Operations are normally called functions, but they are inside a class and can be applied only to objects of that class.

Signature - return-type, a name and zero or more parameters.

The signature describes everything needed to use the operation.

Page 21: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. Example

Page 22: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Class-Association

Associations are structural relationships where instances (objects) of one class are connected to instances (objects) of another class. an employee works for a company a company has a number of offices

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).

Binary association connects exactly two classes.

The most common association is just a connection between classes.

Page 23: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Association adornments: name, role

The association has a name - the descriptive term, often a verb, for the association.

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).

Page 24: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Reflexive Associations

A class has an association to itself. Example: A directory may contain other directories.

Directory File

0..1parent

subdirectory 0..*

1 0..*

Page 25: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Class Navigability

A navigability arrow on an association shows which direction the association can be traversed or queried.

Page 26: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Class Associations: multiplicity

Multiplicity defines the number of objects associated with an instance of the association.

Default of 1 (1: 1)

0 or 1: 0..1

Zero or more (0..infinite): *

1 or more (1..infinite): 1..*

n..m; range from n to m inclusive

Car Persontransports

passenger

Car Persontransports

passenger

5

Car Persontransports

passenger

*

Car Persontransports

passenger

1..*

Car Persontransports

passenger

2..5

Page 27: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Class - Generalization

A specialization / generalization relationship, in which objects of the specialized element (child) are substitutable for objects of the generalized element (parent). Superclass – the generalization of another class, the child. Subclass – the specialization of another class, the parent.

Vehicle

WindPoweredVehicle

MotorPoweredVehicle

LandVehicle

WaterVehicle

venuevenuepower

power

SailboatTruck

{overlapping} {overlapping}

Page 28: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Generalization - characteristics

Identify common features concerning behaviour and knowledge. Define these common features on a higher level in the inheritance hierarchy.

The aim is at behaviour more than knowledge when combining classes.

Generalization is a bottom-up process.

A superclass includes all common properties of its subclasses.

Page 29: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Specialization - characteristics

Define a new class which is a special appearance of an existing class.

Specialization is a top-down process.

A subclass can have attributes and operations that are specific for that sub-class.

A subclass may redefine operations of its super-class

Page 30: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. Constraints

The basic constructs of association, attribute, and generalization do much to specify important constraints.

They cannot indicate every constraint. These constraints still need to be captured; the class diagram is a good place to do that.

The UML allows you to use anything to describe constraints. The only rule is that we put them inside braces { }.

Page 31: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. CONSTRAINTS

Page 32: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Aggregation and Composition

Associations in which an object is part of a whole are aggregations. 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.

Computer system

Monitor

Building

Floor

1

1

1

1..*

Page 33: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Aggregation and Composition

Page 34: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Alternative Notation for Composition

Page 35: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Advanced Class Concepts : Abstract

An operation is abstract if it has no implementation.A abstract class cannot have any direct instances.Abstract classes only occur in the context of an

inheritance hierarchy.Abstract operations and classes are specified by

writing its name in italics.

Page 36: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Advanced Class Concepts : Abstract cont.

Page 37: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de clases. With Interfaces

Page 38: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. Package Diagram

To simplify complex class diagrams, we can group classes into packages. Packages.

Packages appear as rectangles with small tabs at the top.

The package name is on the tab or inside the rectangle.

The dotted arrows are dependencies.

Page 39: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de clases. PACKAGE DIAGRAM

Page 40: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de secuencia. Interaction

Sequence diagrams and Collaboration diagrams

Class and object diagrams are static model views. Interaction diagrams are dynamic. They describe how objects collaborate.

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. The time progresses as we go down the page.

The Sequence diagram lists objects horizontally, and time vertically, and models these messages over time.

Page 41: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de secuencia. Drawing Elements

Diagram Header Elements

Actor Represents an external person or entity that interacts with the system

Object Represents an object in the system or one of its components

Unit Represents a subsystem, component, unit, or other logical entity in the system (may or may not be implemented by objects)

Separator Represents an interface or boundary between subsystems, components or units (e.g., air interface, Internet, network)

Group Groups related header elements into subsystems or components being modeled and are laid out horizontally at the top of the diagram.

Page 42: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de secuencia. Body Elements

Message

Synchronous Message

Asynchronous Message

Create Message

Destroy Message

Action

Page 43: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de secuencia. Body Elements

Block(Loop or Conditional)

Page Break

Return Message

Free Note

Flow Note

Diagram links

Page 44: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de secuencia. Interaction example

Page 45: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de secuencia. Other example

Page 46: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Page 47: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

SEQUENCE DIAGRAM

Page 48: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de secuencia. Uses

Complex interactions between components

components are being developed in parallel by different teams

Supporting Robust interface covering multiple scenarios

Use case elaboration

can be used to flesh out the details of one or more use cases

Page 49: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de colaboración.Definition

Type of an interaction diagram.

Collaborates the static and dynamic relationship

Focus on Object Roles rather than timing.

Each message in a collaboration diagram has a sequence number.

The Collaboration diagram may be used to:

Describe a specific scenario by depicting the movement of messages between the objects

Show a spatial organization of objects and their interactions, rather than the sequence of the interactions

Page 50: U nified  M odeling  L anguage

GO TO USER ROLES PAGEDiagrama de colaboración. A example

Page 51: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de secuencia. An exampleReserving a copy of book in Library

Page 52: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Diagrama de colaboración. Cont…Reserving a copy of book in Library

Page 53: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

STATE CHART DIAGRAM

Objects have behaviors and state.

The state of an object depends on its current activity or condition.

A statechart diagram shows the possible states of the object and the transitions that cause a change in state.

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.

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.

Page 54: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

State Chart Diagram – Dial Tone

Page 55: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

STATE CHART DIAGRAM - Login

Page 56: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

STATE CHART DIAGRAM

States are rounded rectangles.

Transitions are arrows from one state to another.

Events or conditions that trigger transitions are written beside the arrows.

Uses The life history of a given class, usecase, operation The events that cause a transition from one state to another The actions that result from a state change

Page 57: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

ACTIVITY DIAGRAM

An activity diagram is essentially a fancy flowchart.

Activity diagrams and statechart diagrams are related.

Statechart diagram focuses attention on an object undergoing a process (or on a process as an object).

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.

Page 58: U nified  M odeling  L anguage

GO TO USER ROLES PAGEElement 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.

Page 59: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

ACTIVITY DIAGRAM

Page 60: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Activity Diagram - Example

Page 61: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Implementation diagrams

Show aspects of model implementation, including source code structure and run-time implementation structure

Kinds component diagram deployment diagram

Page 62: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Component Diagram

Introduction to UML

62

Shows the organizations and dependencies among software components

Components include source code components binary code components executable components

Page 63: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

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

Page 64: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Component Diagram

Page 65: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Deployment Diagram

Introduction to UML

65

Shows the configuration of run-time processing elements and the software components, processes and objects that live on them

Deployment diagrams may be used to show which components may run on which nodes

Page 66: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

Deployment Diagram

Page 67: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

The Current Official UML Specification:

The current official version of UML and its associated specifications can be

downloaded from OMG Specifications Catalog page for Modeling and Metadata

Specifications at

http://www.omg.org/technology/documents/modeling_spec_catalog.htm#UML

Page 68: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

UML Certification

OCUPOMG Certified UML Professional

Three Certification Levels: OCUP Fundamental OCUP Intermediate OCUP Advanced

Link : http://www.omg.org/uml-certification/

Page 69: U nified  M odeling  L anguage

GO TO USER ROLES PAGE

References

Web References :

http://www.uml.org/

http://dn.codegear.com/article/31863

http://www-128.ibm.com/developerworks/rational/library/3101.html

http://www.andrew.cmu.edu/course/90-754/umlucdfaq.html

Book References :

UML Distilled by Martin Fowler with kendall Scott, Pearson Education.

User Guide for UML by Grady Booch, Ivar Jacobson and James Rumbaugh

Page 70: U nified  M odeling  L anguage

Thank You