Sie sind auf Seite 1von 78

UML

Fundamentals
Ing. Gerardo Padilla Zárate
gpadilla@cimat.mx
Course Outline
1. Course presentation
2. OO Concepts Review
3. Introduction to UML
4. UML Views
5. Tool Fundamental

15
Course outline (cont..)
6. Structural diagrams
7. Behavior Diagram
8. Model Management Diagrams
9. UML during development process
10. UML and 4GL
11. Review and Critique
Goal:

At the end of the course, attendees will have


achieved the following:
n Create correctly model diagrams using
UML and mapping them to development
process artifacts (source code, execution
entities, etc.)
Complexity
Walker Royce

Dimensions of software complexity


Higher technical complexity
- Embedded, real-time, distributed, fault-tolerant
- Custom, unprecedented, architecture reengineering
- High performance
An average software project:
- 5-10 people Defense
- 10-15 month duration Telecom Weapon System
- 3-5 external interfaces Switch
- Some unknowns & risks National Air Traffic
Commercial Control System
Embedded Compiler
Automotive
Software Large-Scale
Lower CASE Tool Organization/Entity
Simulation
Higher
management management
complexity Small Scientific complexity
- Small scale Simulation - Large scale
- Informal IS Application - Contractual
Distributed Objects Enterprise IS Defense
- Single stakeholder (Family of IS MIS System - Many stake holders
(Order Entry)
- “Products” Applications) - “Projects”
IS Application
GUI/RDB
(Order Entry)
Business
Spreadsheet

Lower technical complexity


- Mostly 4GL, or component-based
- Application reengineering
- Interactive performance
Introduction to
Object Orientation

10
Introduction to Object
Orientation Topics
n Basic Principles of Object Orientation
n Basic Concepts of Object Orientation
Basic Principles of Object
Orientation

Object Orientation

Encapsulation
Abstraction

Modularity

Hierarchy
Abstraction [omg]
n The essential characteristics of an entity
that distinguish it from all other kinds of
entities.
n An abstraction defines a boundary relative
to the perspective of the viewer.
What is Abstraction?
Salesperson

Customer

Product
What is Encapsulation?
n Hide implementation from clients
¨Clients depend on interface
Encapsulation
n Exposing only the details that are relevant: the public
interface.
n What? not How?
n Hiding the “gears and levers”.
n Exposing only the client’s view of the object’s
responsibilities.
n Protects the object from outside interference.
n Protects other objects from relying on details that are
likely to change.
n Reduces interdependencies in the code.
n “Good fences make good neighbors”.
What is Modularity?
n The breaking up of something complex
into manageable pieces
Order
Entry
Order
Fulfillment
Order Processing
System

Billing
What is Hierarchy?
Asset
Increasing
abstraction n Levels of abstraction

BankAccount Security RealEstate

Savings Checking Stock Bond

Decreasing Classes at the same level of the hierarchy


abstraction should be at the same level of abstraction
Introduction to Object
Orientation Topics
n Basic Principles of Object Orientation
n Basic Concepts of Object Orientation
Basic Concepts of Object
Orientation
n Object
n Class
n Attribute
n Operation
n Generalization
n Polymorphism
What is an Object?
English 101
n Behavior
n State Intro to OO 180
Geology 110

n Unique identity World History 200


Geology 110

Algebra 110
Music History 200
Object [omg]
n An entity with a well-defined boundary and
identity that encapsulates state and
behavior. State is represented by
attributes and relationships, behavior is
represented by operations, methods, and
state machines.
n An object is an instance of a class.
What is a Class?
n An object is defined by a class English 101

Intro to OO 180
Geology 110

CourseOffering World History 200


Geology 110

Algebra 110
Music History 200
Class [omg]
n A description of a set of objects that
share the same attributes, operations,
methods, relationships, and semantics.
n A class may use a set of interfaces to
specify collections of operations it provides
to its environment.
What is an Attribute?
Object
Class

Attribute Attribute Value


:CourseOffering
number = 101
startTime = 900
CourseOffering endTime = 1100
number
startTime
endTime :CourseOffering
Name = 104
startTime = 1300
endTime = 1500
What is an Operation?
CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime
What is Generalization?
n One class inherits from another
GroundVehicle
owner Person
ancestor weight
licenseNumber 0..* 1

register( )
generalization

Car Truck Trailer


decendent size tonnage
getTax( )
Inheritance [omg]
n The mechanism by which more specific
elements incorporate structure and
behavior of more general elements related
by behavior.
Generalization
n A taxonomic relationship between a
more general element and a more specific
element.
n The more specific element is fully
consistent with the more general element
and contains additional information.
What is Polymorphism?
n The ability to hide many different implementations
behind a single interface

Manufactor A Manufactor C
Manufactor A
Review: Introduction to Object
Orientation
n What are the four basic principles of object orientation?
Provide a brief description of each.
n What is an Object and what is a Class? What is the
difference between them?
n What is an Attribute?
n What is an Operation?
n What is generalization?
n What is polymorphism?
n Describe the strengths of object orientation.
UML Introduction

15
Why do we model?
n Provide structure for problem solving
n Experiment to explore multiple solutions

n Furnish abstractions to manage complexity


n Reduce time-to-market for business
problem solutions
n Decrease development costs

n Manage the risk of mistakes


The Challenge

Tijuana “shantytown”:
http://www.macalester.edu/~jschatz/residential.html
The Vision

Fallingwater:
http://www.adelaide.net.au/~jpolias/FLW/Images/FallingWater.jpeg
Why do we model
graphically?
n Graphics reveal data.
¨ Edward Tufte
The Visual Display of Quantitative Information,
1983

n1 bitmap = 1 megaword.
¨ Anonymous visual modeler
Quick Tour
n The UML is a graphical language for
¨ specifying
¨ visualizing
¨ constructing
¨ documenting
the artifacts of software systems
UML Goals
The primary design goals of the UML are as follows:
n Provide users with a ready-to-use, expressive visual
modeling language to develop and exchange meaningful
models.
n Support specifications that are independent of particular
programming languages and development processes.
n Provide a formal basis for understanding the modeling
language.
n Support higher-level development concepts such as
components, collaborations, frameworks and patterns.
n Integrate best practices.
composition <<document>>
(whole-part) UML 2.0
relationship

OMG
UML Evolution <<document>>
UML 2.0
2002 Superstructure
(planned)

<<document>>
<<document>>
2001 Q4 UML 2.0
UML 2.0 OCL
(planned) Infrastructure

<<document>>
Q1 2001 UML 1.4 dependency
relationship

<<document>>
1999 UML 1.3

Editorial revision <<document>>


1998 without significant UML 1.2
technical changes.

<<document>>
1997 UML 1.1
(adopted by OMG) From [Kobryn 01a].
OMG UML Contributors
Aonix Microsoft
Colorado State University ObjecTime
Computer Associates Oracle
Concept Five Ptech
Data Access OAO Technology Solutions
EDS Rational Software
Enea Data Reich
Hewlett-Packard SAP
IBM Softeam
I-Logix Sterling Software
InLine Software Sun
Intellicorp Taskon
Kabira Technologies Telelogic
Klasse Objecten Unisys
Lockheed Martin …
OMG UML 1.4 Specification
n UML Summary
n UML Semantics
n UML Notation Guide
n UML Example Profiles
¨ Software Development Processes
¨ Business Modeling
n Model Interchange
¨ Model Interchange Using XMI
¨ Model Interchange Using CORBA IDL
n Object Constraint Language
OMG
Review: UML Introduction
n Why do we model?.
n What are the goals of UML?
n What are the main uses of UML?
n Describe the UML evolution.
n Describe the major parts of UML Specification.
UML Views

10
Basic UML concepts
n Notes
n Artifact
n Classifier
n Stereotypes
Notes
n A note can be added to any UML element
n It is a ‘dog eared’ rectangle
n The note may be anchored to an element
with a dashed line There can be up to one
MaintainScheduleForm per
MaintainScheduleForm user session.
Artifact
n A physical piece of information that is
used or produced by a software
development process.
n Examples of Artifacts include models,
documents, source files, scripts, and
binary executable files.
Classifier
n A mechanism that describes behavioral
and structural features. Classifiers include
interfaces, classes, datatypes, and
components.
Diagram: Classifier View
Element

C <<covalent>>
Carbon Hydrogen
C H

<<covalent>> C
Diagram: Instance View
:Hydrogen :Hydrogen

:Hydrogen :Carbon :Carbon :Hydrogen

:Hydrogen :Hydrogen
Unifying Concepts
n classifier-instance dichotomy
¨ e.g., an object is an instance of a class OR
a class is the classifier of an object
n specification-realization dichotomy
¨ e.g., an interface is a specification of a class OR
a class is a realization of an interface
n analysis-time vs. design-time vs. run-time
¨ modeling phases (“process creep”)
¨ usage guidelines suggested, not enforced
Stereotypes
n Define a new model element in terms of another
model element
n May be applied to all modeling elements
OMG Diagram categories
n Structural Diagrams include the Class
Diagram, Object Diagram, Component Diagram,
and Deployment Diagram.
n Behavior Diagrams include the Use Case
Diagram (used by some methodologies during
requirements gathering); Sequence Diagram,
Activity Diagram, Collaboration Diagram, and
Statechart Diagram.
n Model Management Diagrams include
Packages, Subsystems, and Models
Modeling a house
Multiple views
Views from RUP
Logical View Implementation View

Use Case View

Process View Deployment View

Conceptual Physical
Excercise 1
Ejercicio 1
n Enliste por lo menos 20 artefactos usados
en el proceso de desarrollo.
¨ Incluya
artefactos de todos los tipos
(documentación, archivos binarios, etc.)
n Tiempo: 10 minutos
Break
n 10 minutos
Structural Diagrams
Conceptual model of UML

Things Relationships Diagrams


Structural Modeling: Core Elements
Construct Description Syntax
class a description of a set of objects
that share the same attributes,
operations, methods, relationships
and semantics.
interface a named set of operations that
«interface»
characterize the behavior of an
element.
component a modular, replaceable and
significant part of a system that
packages implementation and
exposes a set of interfaces.
node a run-time physical object that
represents a computational
resource.
Structural Modeling: Core Elements (cont’d)

Construct Description Syntax


constraint¹ a semantic condition or restriction.
{constraint}

¹ An extension mechanism useful for specifying structural elements.


Structural Modeling: Core Elements
(cont’d)
Construct Description Syntax
constraint¹ a semantic condition or restriction.
{constraint}

¹ An extension mechanism useful for specifying structural elements.


Structural Modeling: Core Relationships
Construct Description Syntax
association a relationship between two or more
classifiers that involves connections
among their instances.
aggregation A special form of association that
specifies a whole-part relationship
between the aggregate (whole) and
the component part.
generalization a taxonomic relationship between a
more general and a more specific
element.
dependency a relationship between two modeling
elements, in which a change to one
modeling element (the independent
element) will affect the other modeling
element (the dependent element).
Structural Diagrams
n Deployment Diagram
n Component Diagram
n Object Diagram
n Class Diagram
Node
n A node is classifier that
represents a run-time
computational resource,
which generally has at least a
memory and often processing
capability. Run-time objects
and components may reside
on nodes.
Deployment Diagrams
n Deployment diagrams show the configuration of
run-time processing elements and the
software components, processes, and objects
that execute on them. Software component
instances represent run-time manifestations of
software code units.
n Components that do not exist as run-time
entities (because they have been compiled
away) do not appear on these diagrams, they
should be shown on component diagrams.
Relationships
n An association between nodes indicates a
communication path between the nodes
n Component instances and objects may be
contained within node instance symbols.
Deployment Diagrams
Structural Diagrams
n Deployment Diagram
n Component Diagram
n Object Diagram
n Class Diagram
Component
n A modular, deployable, and
replaceable part of a system that
encapsulates implementation and
exposes a set of interfaces.
n A component is typically specified
by one or more classifiers (e.g.,
implementation classes) that
reside on it, and may be
implemented by one or more
artifacts (e.g., binary, executable,
or script files).
Component Diagram
n A component diagram shows the dependencies
among software components
¨ for example, implementation classes
¨ the artifacts that implement them; such as, source
code files, binary code files, executable files, scripts.
n A component diagram has only a type form, not
an instance form. To show component
instances, use a deployment diagram
Construct Description Syntax
Relationships
association a relationship between two or more
classifiers that involves connections
among their instances.
aggregation A special form of association that
specifies a whole-part relationship
between the aggregate (whole) and
the component part.
generalization a taxonomic relationship between a
more general and a more specific
element.
dependency a relationship between two modeling
elements, in which a change to one
modeling element (the independent
element) will affect the other modeling
element (the dependent element).
Example Component Diagram
Example Deployment Diagram
Notice!

Component Deployment

Classifier Instance
Review: Structural Diagrams:
Component and Deployment Diagrams
n What is a node?
n What is a deployment diagram?
n What is a component ?
n What is a componet diagram?
n What is the relation between Component and Node?
Excercise 2
Ejercicio 2
n Con base a uno de sus artefactos
(similares a elementos de ejecución)
elabore un ejemplo de un diagrama de
componentes y uno de despliege.

Das könnte Ihnen auch gefallen