introduction to uml by jan pettersen nytun, page 1 introduction to uml

22
Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Upload: buddy-butler

Post on 30-Dec-2015

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 1

Introductionto

UML

Page 2: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 2

UML Is Based on Object-UML Is Based on Object-oriented Conceptsoriented Concepts

• A program will typically consist of objects that cooperate to solve a task.

• An object will typically have attributes (data) and methods (behavior), this defines the state of the object and the manner in which the object operate.

• Objects communicate by sending messages to each other. Sending a message to an object is the same as calling a method of the object.

Page 3: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 3

Class and Object as Defined by Class and Object as Defined by Booch, Rumbaugh and JacobsonBooch, Rumbaugh and Jacobson

• ClassClass: A description of a set of objects that share the same attributes, operations, relationships, and semantics.

• ObjectObject: A concrete manifestation of an abstraction; an entity with a well defined boundary and identity that encapsulates state and behavior; an instance of a class.

Page 4: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 4

UMLUML• The UML is a language for

– visualizingvisualizing– specifyingspecifying– constructingconstructing– documentingdocumenting

the artifacts of a software-intensive system

• UML can also be applied outside the domain of software development.

Page 5: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 5

UUMMLL

UnifiedUnified:

• Unification of earlier object-oriented analysis and design methods.

• Same concepts and notation for different application domains and different development processes.

• Same concepts and notation through the whole development lifecycle.

~~~~ Modeling:Modeling:

• Making a semantically* complete abstraction of a system.(* The formal specification of the meaning and behavior of something)

Language:Language:

• A graphical language~~

Page 6: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 6

UMLUMLOriginsOrigins

«specification»UML0.8

«specification»UML0.9

«specification»UML1.0

«specification»UML1.1

«specification»UML1.2

«specification»UML1.3

«refine»

«refine»

«refine»

«refine»

«refine»

1995

1996

January 1997(initial submission toOMG)

September 1997(final submission toOMG)

Editorial revisionWith no significantTechnical changes

«specification»UML1.4

«refine»2001

«specification»UML2.0

Page 7: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 7

Some of the UML GoalsSome of the UML Goals• Define an easy-to-learn but semantically rich visual modeling

language.

• Unify ideas from other modeling languages and incorporate industry best practices.

• Support higher-level development concepts such as collaborations (design patterns), frameworks and components.

• Provide flexibility for applying different processes and mapping to different programming languages.

• Support extensibility and specialization mechanisms so that the core concepts can be extended.

• Provide a formal basis so that model interchange between different OO tools will be possible.

Page 8: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 8

The Value of UMLThe Value of UML• Open standard.

• Supported by many tools.

• Supports the entire development lifecycle.

• Support diverse application areas.

• Based on experience and needs of the user community.

Page 9: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 9

UML 1.3 Is Not a Visual UML 1.3 Is Not a Visual Programming LanguageProgramming Language

• UML 1.3 is a visual modeling language. It does not have all necessary visual and semantic support to replace programming languages.But the introduction of Action Semantics into UML has changed this!

• But UML has a tight mapping to a family of OO languages like C++ and Java.

Page 10: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 10

[6] “Action Semantics UML Extensions let you express actions as UML objects. An Action object may take a set of inputs and transform it into a set of outputs (although one or both sets may be empty), or may change the state of the system, or both. Actions may be chained, with one Action's outputs being another Action's inputs. Actions are assumed to occur independently - that is, there is infinite concurrency in the system, unless you chain them or specify this in another way. This concurrency model is a natural fit to the distributed execution environment of modern enterprise and Internet applications.”

Page 11: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 11

Executable UMLExecutable UML• Abstracting away:

– programming language, software organization

• Class diagrams – showing “things” and structure (data):– classes, attributes, associations, constraints

• Statechart diagrams – showing object lifecycle (control):– states, events, transitions, procedures

• Action language – showing behavior (algorithm):– actions

Page 12: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 12

[2]: The MDA[2]: The MDAProcessProcess

[1]: “… separates the specification of system functionality from the specification of the implementation of that functionality on a specific technology platform.”

[2]:• First, you build a model with a high level of abstraction, that is independent of

any implementation technology. This is called a Platform Independent Model (PIM).

• Next, the PIM is transformed into one or more Platform Specific Models (PSMs). A PSM is tailored to specify your system in terms of the implementation constructs that are available in one specific implementation technology, e.g. a database model, an EJB model.

• The final step is to transform a PSM to code. Because a PSM fits its technology very closely, this transformation is rather trivial. The complex step is the one in which a PIM is transformed to a PSM.

PSMBridge

CodeBridge

Page 13: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 13

MDA Example 1MDA Example 1Several ApplicationSeveral Application

Platform Independent Model

CORBAModel

EJB Model

XML/SOAPModel

Other Models

XML/SOAPCode

CORBACode

EJB Code

Other Code

PIM

Reverse engineer

First transformation

PSM

Second transformation

Implementation

Page 14: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 14

MDA Example 2MDA Example 2Three Tier Solution – One ApplicationThree Tier Solution – One Application

PIM

PSMEJB Comp.

PSMRelational DB

PSMWeb

PSMEJB Code

PSMSQL Code

PSMJSP Code

Page 15: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 15

Software Engineering Software Engineering MethodsMethods

• Most methods consist of both a modeling modeling language and a process language and a process (who is doing what and when).

• The modeling language, the notation, typically include some visual languagevisual language (different types of diagrams).

• A tooltool to support the method is also crucial.

Page 16: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 16

Three of the most popular methodsThree of the most popular methods (What is the difference between a methodologist and a terrorist? Answer: You can negotiate with a terrorist.)

• Object Modeling Technique, OMTOMT, introduced by Jim Rumbaugh. OMT is considered to be strong on analysis and weaker in the design area.

• BoochBooch, introduced by Grady Booch (Rational Software). This method is considered to be strong in design and weak when it comes to analysis.

• OOSEOOSE, (use cases ) introduced by Ivar Jacobson. OOSE is considered to be strong when it comes to behavior analysis and weaker in the other areas.

Page 17: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 17

UML Is Not a UML Is Not a Development ProcessDevelopment Process

A development process defines: - Who is doing What, - When to do it, and - How to reach a certain goal

• The UML is intentionally process independent, and defining a standard process was not a goal of UML. Different domain may require different processes.

• But the UML authors promote a development process that is use-case-driven, architecture centric, iterative and incremental. (Example of method: RUP)

Page 18: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 18

AbstractionAbstraction• Abstraction Abstraction is a fundamental human capability, it

let us filter out nonessential detailsfilter out nonessential details about a complex problem or structure.

• Through abstraction a system can be viewed at viewed at different levelsdifferent levels.Often there is a hierarchic structure, each level of model is more precise than its parent. When developing a software system, code will be the lowest and most detailed level.

Page 19: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 19

ModelingModeling• When you make a modela model you are making a mapping from the mapping from the

problem domain to a representationproblem domain to a representation of the system you are modeling.

• When you work object-oriented the model tends to be close to the system modeled, and a program execution can be regarded as a program execution can be regarded as a simulation of the behavior of the system.a simulation of the behavior of the system.

Reality

SystemSystem

Page 20: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 20

Why Do We Model?Why Do We Model?• Models give us a template that guides us in

constructing a system.

• If you want to make a building you first make a blueprint of the building to make, in the same way you should make a model of the system you want to make. As the complexity of systems increases, so does the importance of good modeling techniques.

• Models help us visualize a system at different levels of abstraction, this makes it easier to manage complexity and to understand the system.

Page 21: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 21

More Arguments -More Arguments -Why Do We Model?Why Do We Model?

• It is not expensive to experiment with multiple solutions when you operate on a high level of abstraction.

• Models document the decisions we have made.

• Models help for communication between different stakeholders.

Page 22: Introduction to UML by Jan Pettersen Nytun, page 1 Introduction to UML

Introduction to UML by Jan Pettersen Nytun, page 22

ReferencesReferences[1] OMG Editor: Model Driven Architecture (MDA) (ormsc/01-07-01)

http://www.omg.org/cgi-bin/doc?ormsc/2001-07-01 Accessed 19 August 2002

[2] Addison-Wesley, MDA Explained: The Model Driven Architecture™: Practice and PromiseAnneke Kleppe, Jos Warmer, Wim Bast(Klasse Objecten, Soest, the Netherlands http://www.klasse.nl/english/mda/mda-introduction.html)

[6] Introduction to OMG's Unified Modeling Language™ (UML™)[accessed Aug. 2002] http://www.omg.org/gettingstarted/what_is_uml.htm

Grady Booch, James Rumbaugh and Ivar Jacobson:The Unified Modeling Language User Guide.Addison-Wesley, 1999

James Rumbaugh, Michael Blaha, William Premerlani, Frederick Eddy and William Lorenzen: Object-Oriented Modeling and Design. Prentice Hall, 1991

Martin Fowler with Kendall Scott: UML Distilled.Addison-Wesley, 1997

Terry Quatrani: Visual Modeling with Rational Rose and UML.Addison-Wesley, 1998

Rational software: http://www.rational.com/uml/documentation.html