uml course ppts

30
UML (Unified Modeling Language) U M L

Upload: satyakiranpriya

Post on 12-Nov-2014

4.293 views

Category:

Documents


0 download

DESCRIPTION

This is a ppt for the course of UML I chapter in JNTU university, India. It contains all the slides for the 1st unit.

TRANSCRIPT

Page 1: UML course ppts

UML(Unified Modeling Language)

UML

Page 2: UML course ppts

1. Introduction to UML2. Basic Structural Modeling3. Advanced Structural Modeling4. Class & Object Diagrams5. Basic Behavioral Modeling - I6. Basic Behavioral Modeling - II 7. Advanced Behavioral Modeling8. Architectural Modeling

Concepts in UML

Page 3: UML course ppts

Introduction to UML:

Importance of Modeling Principles of Modeling

Conceptual Model of UML

Object Oriented Modeling

ArchitectureSoftware Development Life Cycle

History of UML

Basic Structural Modeling:ClassesRelationshipsCommon MechanismsDiagrams

Page 4: UML course ppts

Advanced Structural Modeling:Advanced ClassesAdvanced RelationshipsInterfacesTypes and RolesPackages

Class & Object Diagrams:TermsConceptsModeling Techniques for Class & Object Diagrams

Page 5: UML course ppts

Basic Behavioral Modeling – I:InteractionsInteraction Diagrams

Behavioral Modeling – II:Use Cases

Use Case Diagrams

Activity Diagrams

Page 6: UML course ppts

Advanced Behavioral Modeling:Events and SignalsState MachinesProcess and ThreadsTime and SpaceState Chart Diagrams

Architectural Modeling:ComponentDeploymentComponent Diagrams and Deployment Diagrams

Page 7: UML course ppts

Introduction to UML:-

The UML enables system builders to create “blueprints” that capture their visions in a standard , easy-to-understand way and communicate them to others.

What is UML:- UML stands for Unified Modeling Language is a standard language for writing software blueprints used to specify, visualize, construct & document the artifacts of an object-oriented s/w intensive system under development.

Why only UML?

Page 8: UML course ppts

History of UML:- Grady Booch, James Rumbaugh and Ivar Jacobson are the “Three Amigos” who developed this UML in the ending of 1996.

These gentlemen worked in separate organizations through the ‘80s and early ‘90s each devising his own methodology for Object-Oriented analysis and design.

In 1994, Rumbaugh joined Rational Software Corporation, where Booch was already working. Jacobson enlisted at Rational a year later.

UML is a merged technique which is merged from the concepts of Booch Methods, Object Modeling Techniques & Object-Oriented Software Engineering(OOSE).

UML combines the best practices from Data Modeling concepts such as Entity Relationship diagrams, Data Flow, Work Flow diagrams, Object Modeling & Component Modeling.

The UML consists a number of graphical elements that combine to form diagrams. The purpose of the diagrams is to present multiple views of a system, and this set of multiple views is called a “Model”.

In 1997, the UML consortium produced version 1.0 of the UML and submitted it to the Object Management Group(OMG) for a standard modeling language.

Page 9: UML course ppts

Versions of UML:-UML 1.0 in 1996UML 1.1 in 1997UML 1.2 in 1999UML 1.3 in 2000UML 1.4 in 2001UML 1.5 in 2003UML 2.0 in 2005UML 2.1.1 in 2007UML 2.1.2 in 2007

Page 10: UML course ppts

Importance of Modeling:-• Modeling is a proven and well-accepted engineering technique.

• A Model is a simplification of reality.

• A Model provides the blue prints of a system.

• We build Models so that we can better understand the system we are developing.• Models helps us to visualize a system as it is or as we want it to be.

• Models permits us to specify the structure or behavior of a system.

• Models gives us a template that guides us in constructing a system.

• Models document the decisions we have made.

• We build Models of complex systems because we cannot comprehend such a system in its entirety.

• Finally, we build Model to control the system.

Page 11: UML course ppts

Principles Of Modeling:- I. The choice of what models to create has a profound influence on how a problem is and how a solution is shaped.

II. Every model may be expressed at different levels of precision.III. The best models are connected to reality.

IV. No Single model is sufficient, Every nontrivial system is best approached through a small set of nearly independent models.

Object-Oriented Modeling:- In Object-Oriented Modeling approach, the main building block of all software system is the “ Object “ or “ Class “. Simply put, an Object is a “ Thing “.

A Class is description of a set of common objects.

Every object has identity, state, and behavior.

Visualizing, specifying, constructing, and documenting object-oriented systems is exactly the purpose of the Unified Modeling Language.

Page 12: UML course ppts

UML as a Language: A Language provides a vocabulary & the rules for communication that focus on physical & conceptual representation of a system, UML tells you how to create & read well-formed models, but they don’t tell you what models you should create and when to create.

Overview of UML:-

UML for Specification: UML address the specification of all the important analysis, design & implementation decisions that must be made in developing and deploying a software intensive system.

UML for Visualizing: UML is such a graphical language that some “ Things “ can be modeled textually and some are best modeled graphically.

UML for Construction: UML is not only a visual programming language but its models can be directly connected to a variety of programming languages.

UML for Documentation: UML addresses the documentation of a system architecture and its details, requirements, activities of project planning & release management.

Page 13: UML course ppts

Conceptual Model of UML:- To understand UML, learners need to know about the Conceptual Model of this language and this requires learning three major elements. They are,

1) Basic Building Blocks

2) Rules

3) Common Mechanisms

Page 14: UML course ppts

Basic Building Blocks: The Vocabulary of UML encompasses three kinds of building blocks. They are,

1. Things2. Relationships3. Diagrams

• “ Things “ form the vocabulary(Nouns) of a system and they are the abstractions of a particular model, “ Relationships “ tie the things together, “ Diagrams “ group related things together.

Page 15: UML course ppts

Things in UML:-There are four kinds of “ Things “ in UML. They are,

1) Structural Things:- Structural things are the “ Nouns “ and are the static parts of an UML model.

2) Behavioral Things:- Behavioral things are the “ Verbs ” and are the dynamic parts of an UML model.

3) Grouping Things:- Grouping things are the Organizational parts of an UML model.

4) Annotational Things:- Annotational things are the Explanatory parts of an UML model.

Structural things are classified into 7 types.Behavioral things are classified into 2 types.Grouping things are classified into 1 type.Annotatational things are classified into 1 type.

Page 16: UML course ppts

Structural Things are of 7 types, they are,1. Class:- A Class is a description of a set of objects that share the same

attributes, operations, relationships & semantics, class may implement one or more interfaces. Graphically, a class is rendered as a “ Rectangle ” with three compartments for Name of the class, Attributes, Operations as shown below.

Name of the Class

Attributes

Operations

2. Interface:- An Interface is a collection of operations that specify “ what to do “. Graphically, an interface is rendered as a “ Circle ” with it’s name as shown below.

Interface name

Page 17: UML course ppts

3. Collaboration:- A Collaboration defines an interaction & it is a set of roles and responsibilities. Generally, a collaboration is realized by a “ Use Case ”. Graphically, a collaboration is rendered as an “ Ellipse with Dashed Lines “ as shown below.

Roles

4. Use Case:- A Use Case is a description of a set of sequence of actions that a system performs with a particular actor. A use case is graphically rendered as an “ Ellipse with Solid Line ” as shown below.

Action Name

5. Active Class:- An Active Class is a class where objects own one or more processes or threads to initiate a control activity. Graphically, an active class is rendered like a “ Class but with Thick Lines “ as shown below.

Page 18: UML course ppts

6. Component:- A Component is a physical and replaceable part of a system which provides the realization of Interfaces. Graphically, a component is rendered as a “ Rectangle with Tabs “ as shown below.

7. Node:- A Node is a physical element that exists at runtime & represents a computational resource like memory. Graphically, a node is rendered as a “Cube“ including the name.

Name.java

Server

Behavioral Things are of 2 types, they are,1) Interaction:- An Interaction is a behavior that comprises a set of messages

exchanged among a set of objects. Graphically, an interaction message is rendered as a “ Directed Arrow Line ” including the name of the operation as shown below. Operation Name

Page 19: UML course ppts

2) State Machine:- A State Machine is a behavior that specifies the sequences of states. Graphically, a state is rendered as a “ Rounded Rectangle “ with it’s name and also it’s state as shown below.

State Name

Grouping Things are of 1 type, it is,i. Package:- A Package is a general purpose mechanism for organizing elements into groups. Graphically, a package is rendered as a “ Tabbed Folder ” as

shown below.

Package Name

Annotational Things are of 1 type, it is, I. Note:- A Note is a special kind of graphical symbol used to specify comments or constraints. Graphically, a note is rendered as a “ Rectangle with a dog-eared corner “ as shown below.

Comments

Page 20: UML course ppts

Relationships in UML:-There are four types of “ Relationships “ in UML. They are,

i. Dependency:- A Dependency is a Semantic relationship between two things in which a change to one thing may affect the semantics of the other thing. Graphically, a dependency is rendered as a “ Dashed Arrow “ as shown below.

ii. Association:- A Association is a Structural relationship that describes a set of links that connected among Objects. Aggregation is a special kind of association representing a structural relationship b/w a whole and its parts. Graphically, an association is rendered as a “ Solid Line “ as shown below.iii. Generalization:- A Generalization is a Specialization / Generalization relationship in which Objects of the specialized elements are substitutable for objects of the generalized element. Graphically, a generalization relationship is rendered as a “ Solid Line with a Hallow Triangle Arrow Head ” as shown below iv. Realization:- A Realization is graphically rendered as a ” Dashed Line with a Hallow Triangle Arrow Head “ as shown below.

Page 21: UML course ppts

Diagrams in UML:-There are two kinds of “ Diagrams “ in UML. They are,

I. Static (or) Structural DiagramsII. Dynamic (or) Behavioral Diagrams

In UML, a total of 9 diagrams are available that are classified either into Static or Dynamic. They are,

1. Class Diagram:- Class shows the entities in a system or a domain and how these entities relate to one another.

2. Object Diagram:- Object shows instances of the classes and their inter- relationships.3. Use Case Diagram:- Use Case shows system usage, this appears with an actor or stick figure.

4. Sequence Diagram:- Sequences visualizes how the Objects in a system interact with one another over time.

5. Collaboration Diagram:-Collaboration is another way of visualizing how Objects work together overtime.

Page 22: UML course ppts

6. State Chart Diagram:- State Captures the state of an Object during a specific time period.

7. Activity Diagram:- Activity shows the steps and decision points that occur within the behavior of an Object, or within a business process.

8. Component Diagram:- Component models the software components of a system.

9. Deployment Diagram:- Deployment represents the physical architecture of a computer-based system.

The UML has various semantic rules for,

Rules:

i. Namesii. Scope iii. Visibility iv. Integrity v. Execution

Page 23: UML course ppts

Common Mechanisms in UML:There are four types of mechanisms available in UML. They are,

1. Specifications Mechanism:- UML is a language which is not only meant for visualizing the system but also used for specifying the various artifacts of an intensive system. 2. Adornments Mechanism:- In UML , some of the vocabulary of the system are elided(hided) because of the rules . In order to expose some of the facts, UML has a mechanism often known as “ Adornments ” which may be in the form of graphical or textual.

3. Common Divisions Mechanism:-The Common divisions are, Class & Object Interface & Implementation

4. Extensibility Mechanism:- UML provides a mechanism to extend the various naunces(issues) such as vocabulary, properties, & semantics using three extensibility mechanisms known as Stereotypes, Tagged values & Constraints.

Page 24: UML course ppts

ImplementationView

I. Use Case View:- A Use Case View of a system encompasses the use cases that describe the behavior of the system. In UML, “ Static “ aspects of this view are captured in Use Case diagrams, the “ Dynamic “ aspects of this view are captured in Interaction, State Chart and Activity diagrams.

DesignView

ProcessView

DeploymentView

Use CaseView

Architecture of UML:- In UML, the architecture of a s/w intensive system can be best described by the following 4+1 architecture view.

An Architecture is a set of significant decisions about,1. The Organization of the system.2. The selection of structure elements and their interfaces.3. Their behavior and collaborations among other elements.4. The composition of structural and behavioral elements.5. The architecture style that guides the organization.

Page 25: UML course ppts

III. Process View:- The Process View of a system encompasses threads and processes that form the system. The same type of diagrams used for Design View are used for this view but Classes are replaced with Active Class .

IV. Implementation View:- The Implementation View of a system encom- passes the components and files are used to assemble and release the physical system. The “ Static “ aspects of this view are captured using Component diagrams, the “ Dynamic “ aspects of this view are captured using Interaction, State Chart and Activity diagrams.

II. Design View:- The Design View of a system encompasses the classes, interfaces and collaboration that form the vocabulary of the system. In UML, the “ Static ” aspects are captured using Class diagrams and Object diagrams, the “ Dynamic “ aspects are captured using Interaction, State Chart & Activity diagrams.

V. Deployment View:- The Deployment View of a system encompasses the nodes that from the systems hard-ware topology. The “ Static “ aspects of this view are captured using Deployment diagrams whereas the “ Dynamic “ aspects of this view using Interactive, State Chart and Activity diagrams.

Page 26: UML course ppts

Software Development Life Cycle(SDLC):- UML is lastly based on the topic “ process independent “. However, to get the most benefits from UML we should consider a process which is,i. Use-Case drivenii. Architecture-Centriciii. Interactiveiv. Incremental Use Case driven means that use cases are used as a primary artifact for establishing the desired behavior of the system, for verifying and validating the systems architecture, for testing and communicating among the stakeholders of the project.Architecture-Centric means that a system’s architecture is used as a primary artifact for conceptualizing, constructing, managing and evolving the system under development.An Interactive process is one that involves managing a stream of executable releases.An Incremental process is one that involves the continuous integration of the systems architecture to produce the releases. Together, an interactive & incremental process is risk-driven, meaning that each new release is focused on attacking and reducing the most significant risks to the success of the project.

Page 27: UML course ppts

Overview of Conceptual Model in UML

Basic Building Blocks

Rules Common Mechanisms

ThingsRelationshipsDiagrams

NamesScopeVisibilityIntegrityExecution

SpecificationsAdornmentsCommon DivisionsExtensibility

Page 28: UML course ppts

Things

Structural Things

BehavioralThings

GroupingThings

AnnotationalThings

Class

Interface

Collaboration

Use Case

Active Class

Component

Node

Interaction

State Machine

Package Note

Page 29: UML course ppts

Relationships

Dependency

Association/Aggregation

Generalization/Specialization

Realization

Diagrams

Class Diagram

Object Diagram

Use Case Diagram

Sequence Diagram

Collaboration Diagram

State Chart Diagram

Activity Diagram

Deployment Diagram

Component Diagram

Page 30: UML course ppts

Rules

Name Scope Visibility Integrity Execution

Common MechanismsAdornments

Common Divisions

Extensibility

Specifications