Beruflich Dokumente
Kultur Dokumente
Clase 6
UML
UNPSJB - 2005
Contenido de la clase 6
UNPSJB - 2005
Introduccin
Modelado del soft
UML (Conceptos bsicos)
Paradigma OO
Fundamentos
Diagramas de CU
Diagramas de Interacciones
Diagramas de clase
Diagramas de estado/actividad
Diagrama de componentes
Diagrama de despliegue
Bibliografa
UML
www.dsic.upv.es/~uml
UML
UNPSJB - 2005
www.omg.org/uml
Ingeniera de Software - Clase 6
Ejemplos
Modelado mnimo
Proceso simple
Herramientas simples
Construida
eficientemente y en
un tiempo razonable
de un equipo
Modelado
Proceso bien
definido
Herramientas ms
sofisticadas
Construccin de un
rascacielos
Construccin de una
casa
UNPSJB - 2005
Construccin de una
cucha para un perro
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Contexto de
desarrollo
Determinar
configuracin del
proceso
Recursos necesarios
Herramientas ms
sofisticadas an.
Claves en Desarrollo de SI
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Notacin
Herramientas
UNPSJB - 2005
Proceso
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
envo
Proceso de Negocios
Sistema Computacional
UNPSJB - 2005
Qu es UML?
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Modelado
Modelado
Modelado
Modelado
Orientado a Objetos
de Datos
de Componentes
de Flujos de Trabajo (Workflows)
Motivacin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Historia de UML
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
Historia de UML
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UML 2.0
2001
UML 1.4
2000
1999
1998
Nov 97
UNPSJB - 2005
UML 1.3
UML aprobado por el OMG
UML 1.2
Revisiones
menores
10
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UML aglutina enfoques OO
Rumbaugh
Booch
Jacobson
Odell
Meyer
Pre- and Post-conditions
Shlaer-Mellor
UML
Harel
State Charts
Embly
Singleton classes
Wirfs-Brock
Fusion
Responsabilities
Operation descriptions,
message numbering
UNPSJB - 2005
11
Aspectos Novedosos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Stereotypes
Constraints
Tagged Values
UNPSJB - 2005
12
Inconvenientes en UML
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
13
Perspectivas de UML
Evidencias:
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
14
Modelos y Diagramas
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
15
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
16
Diagramas de UML
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Diagrama de Estados
Diagrama de Actividad
Diagramas de Interaccin
Diagrama de Secuencia
Diagrama de Colaboracin
Diagramas de implementacin
UNPSJB - 2005
Diagrama de Componentes
Diagrama de Despliegue
17
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Use Case
Use Case
Diagramas de
Diagrams
Diagrams
Casos de Uso
Scenario
Scenario
Diagramas de
Diagrams
Diagrams
Colaboracin
Scenario
Scenario
Diagramas de
Diagrams
Diagrams
Estados
UNPSJB - 2005
State
State
Diagramas de
Diagrams
Diagrams
Clases
State
State
Diagramas de
Diagrams
Diagrams
Componentes
Modelo
Diagramas de
Actividad
State
State
Diagramas de
Diagrams
Diagrams
Objetos
Component
Component
Diagrams
Diagramas
Diagrams de
Distribucin
18
Organizacin de Modelos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Vista Lgica
Vista de
Realizacin
Vista de los
Casos de Uso
Vista de
Procesos
Vista de
Distribucin
UNPSJB - 2005
19
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
... Organizacin de Modelos
UNPSJB - 2005
20
Paquetes en UML
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Nombre de
paquete
UNPSJB - 2005
21
Paquetes en UML
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
22
Paquetes en UML
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
23
Paquetes en UML
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
24
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Preparar Catlogo
Sistema
Inventario
Tipos de Venta
25
Ejemplos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Otro Ejemplo
Venta Normal
Cliente
Solicitar Prstamo
[Tarjeta Caducada]
Vendedor
Venta en Rebajas
Venta en Ofertas
UNPSJB - 2005
<<extend>>
26
Ejemplos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
<<include>>
Verificar Operacin
Cliente
<<include>>
UNPSJB - 2005
27
Diagrama de Secuencia
:WInPrstamos
: Encargado
:Socio
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
:Video
:Prstamo
prestar(video, socio)
verificar situacin socio
verificar situacin video
registrar prstamo
entregar recibo
UNPSJB - 2005
28
Diagrama de Colaboracin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
:Socio
:Video
2: verificar situacin socio
1: prestar(video, socio)
5: entregar recibo
: Encargado
4: registrar prstamo
:Prstamo
UNPSJB - 2005
29
Diagrama de Clases
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
30
Ejemplos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Asociacin
Asociacin
(Clase
(Clase yy Visibilidad)
Visibilidad)
Alumno
Departamento
DNI : char[10]
nmero_exp : int
nombre : char[50]
dirige
0..1
director
Profesor
1
alta()
poner_nota(asignatura : char *, ao : int, nota : float)
matricular(cursos : asignatura, ao : int)
listar_expediente()
UNPSJB - 2005
31
www.dsic.upv.es/~uml
Empresa
empleador
trabajadores
Empleado
1..*
Cargo
nombre
sueldo
superior
0..1
subordinado 1..*
UNPSJB - 2005
32
www.dsic.upv.es/~uml
Trabajador
{ disjunta, completa }
Directivo
UNPSJB - 2005
Administrativo
Obrero
33
Ejemplos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Motor
1..4
1
Avin
Vendedor de billetes
Piloto
1..2
Vuelo
Reserva
{ disjunta, completa }
1
Avin militar
Avin comercial
Lnea area
{ disjunta, completa }
Avin de carga
UNPSJB - 2005
Avin de pasajeros
34
Diagrama de Estados
alta
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
baja
nmero_prstamos = 0
sin prstamos
Socio
nmero : int
nombre : char[50]
nmero_prestamos : int = 0
prestar
devolver[ nmero_prstamos = 1 ]
alta()
baja()
prestar(cdigo_libro : int, fecha : date)
devolver(cdigo_libro : int, fecha : date)
nmero_prstamos > 0
con prstamos
prestar
35
Diagrama de Actividad
Buscar Bebida
[no zumo]
[hay caf
Poner caf en filtro
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
[hay zumo]
Encender mquina
/ cafetera.On
Caf en preparacin
indicador de fin
Servir caf
UNPSJB - 2005
Beber
36
Solicitar pasaje
Vendedor
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Airline
Verificar
existencia vuelo
Dar detalles vuelo
Informar alternativas
y precios
Seleccionar vuelo
Pagar pasaje
Emitir billete
UNPSJB - 2005
37
Diagrama Componentes
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Control y Anlisis
Interfaz de Terminal
Comment
Comment
Gestin de Cuentas
Comment
UNPSJB - 2005
Rutinas de Coneccion
Comment
Acceso a BD
Comment
38
Diagrama de Despliegue
Servidor Central
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Control y Anlisis
Comment
Acceso a BD
Comment
Rutinas de Coneccion
Comment
Terminal de Consulta
Rutinas de Coneccion
Comment
Punto de Venta
Interfaz de Terminal
Comment
Rutinas de Coneccion
Comment
Gestin de Cuentas
Interfaz de Terminal
Comment
Comment
UNPSJB - 2005
39
Resumen
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
40
UML
Paradigma OO
Diagramas
UNPSJB - 2005
41
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Por qu la Orientacin a Objetos?
Modelado integrado de
propiedades estticas y
dinmicas del mbito del
problema
Facilita construccin,
mantenimiento y reutilizacin
UNPSJB - 2005
Conceptos comunes
de modelado durante
el anlisis, diseo e
implementacin
Facilita la transicin
entre distintas fases
Favorece el desarrollo
iterativo del sistema
Disipa la barrera
entre el qu y el
cmo
42
Problemas en OO
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
43
Problemas en OO
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
44
DFDs
E-R
Enfoque OO
UNPSJB - 2005
Diseo
DEs
Modelo
Relacional
Modelo
Relacional !!
Diagrama de Clases
Diagrama de Estados
Diagramas de Actividad
Ingeniera de Software - Clase 6
Implementacin
Entornos de
Programacin
Visual
Bases de Datos
(Objeto-)
Relacionales
45
UNPSJB - 2005
46
Casos de Uso
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
47
Casos de Uso
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Caso de Uso A
Caso de Uso B
Actor B
48
Casos de Uso
Actores:
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
49
Casos de Uso
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
50
www.dsic.upv.es/~uml
Casos de Uso: Relacioneswww.dsic.upv.es/~uml
Comunicacin
Inclusin : una
instancia del Caso de
Uso origen incluye
tambin el
comportamiento
descrito por el Caso de
Uso destino
<<include>>
Actor
UNPSJB - 2005
<<include>>
reemplaz al
denominado <<uses>>
51
Caso de Uso
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Casos de Uso: Relaciones
Extensin : el Caso
de Uso origen
extiende el
comportamiento
del Caso de Uso
destino
Herencia : el Caso
de Uso origen
hereda la
especificacin del
Caso de Uso
destino y
posiblemente la
modifica y/o ampla
<<extend>>
UNPSJB - 2005
52
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Casos de Uso: Relaciones
Ejemplo:
Identificacin
<<include>>
Cliente
Transferencia
<<extend>>
Transferencia en Internet
UNPSJB - 2005
53
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Casos de Uso: Relaciones
UNPSJB - 2005
Ejemplo:
54
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Casos de Uso: Construccin
UNPSJB - 2005
55
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Casos de Uso: Construccin
UNPSJB - 2005
56
Precondicin
Secuencia
Normal
Postcondicin
Excepciones
Rendimiento
Frecuencia esperada
Importancia
Urgencia
Comentarios
UNPSJB - 2005
57
UNPSJB - 2005
58
Diagramas de Interaccin
UNPSJB - 2005
59
Interaccin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
60
Diagramas de interaccin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
El Diagrama de Secuencia es ms
adecuados para observar la perspectiva
cronolgica de las interacciones
El Diagrama de Colaboracin ofrece una
mejor visin espacial mostrando los
enlaces de comunicacin entre objetos
El D. de Colaboracin puede obtenerse
automticamente a partir del
correspondiente D. de Secuencia (o
viceversa)
Ingeniera de Software - Clase 6
61
Diagrama de Secuencia
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
62
www.dsic.upv.es/~uml
Diagrama de Secuenciawww.dsic.upv.es/~uml
UNPSJB - 2005
63
Diagrama de Secuencia
mostrando foco de
control,
condiciones, recursin
creacin y destruccin
de objetos
UNPSJB - 2005
64
www.dsic.upv.es/~uml
Diagrama de Secuenciawww.dsic.upv.es/~uml
UNPSJB - 2005
65
www.dsic.upv.es/~uml
Diagrama de Colaboracinwww.dsic.upv.es/~uml
UNPSJB - 2005
66
Mensajes
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Un mensaje
desencadena una
accin en el objeto
destinatario
Un mensaje se enva
si han sido enviados
los mensajes de una
lista (sincronizacin):
Un mensaje se
enva de manera
condicionada:
[x>y] 1: Mensaje
A
A.1, B.3 / 1:Mensaje
A
UNPSJB - 2005
67
Mensajes
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
68
Diagrama de Clases
UNPSJB - 2005
69
Clasificacin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Clasificacin / Instanciacin
Composicin / Descomposicin
Agrupacin / Individualizacin
Especializacin / Generalizacin
70
Clases
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
La clase define el
mbito de
definicin de un
conjunto de objetos
Cada objeto
pertenece a una
clase
Los objetos se
crean por
instanciacin de las
clases
Cada clase se
representa en un
rectngulo con tres
compartimientos:
nombre de la clase
atributos de la clase
operaciones de la
clase
motocicleta
color
cilindrada
velocidad maxima
arrancar
acelerar
frenar
71
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Otros ejemplos:
lista
pila
primero
ultimo
aadir
quitar
cardinalidad
UNPSJB - 2005
apilar
desapilar
cardinalidad
72
Clases: Encapsulacin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
73
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
74
Clases: Encapsulacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Ejemplo:
Reglas de visibilidad
+ Atributo pblico : int
# Atributo protegido : int
- Atributo privado : int
+ "Operacin pblica"
# "Operacin protegida"
- "Operacin privada"
UNPSJB - 2005
75
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
76
Asociacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Univ. de Murcia:Universidad
Un enlace
Antonio:Estudiante
Universidad
Estudiante
Una asociacin
UNPSJB - 2005
77
Asociacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Ejemplo:
marido
casado-con
Administra
UNPSJB - 2005
0.. 1
mujer
jefe
0.. 1
0.. 1
Persona *
nombre
s. s.
trabaja-para
emplea-a
* Compaa
nombre
direccin
empleado
78
Asociacin
Especificacin de multiplicidad
(mnima...mxima)
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
1
0..1
M..N
*
0..*
1..*
79
Asociacin Cualificada
Aerolnea
Tablero
Ajedrez
nro_billete
0..1
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Viajero
fila
columna
Cuadro
UNPSJB - 2005
80
Agregacin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
81
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Agregacin: Caracterizacin
Multiplicidad Mnima
0
flexible
> 0 estricta
Multiplicidad
Objeto
Agregado
(mna, mxa)
Multiplicidad Mnima
(mnc,
0
nulos permitidos
> 0 nulos no
Objeto
permitidos
UNPSJB - 2005
mxc)
Mxima
1
disjunto
> 1 no disjunto
Multiplicidad Mxima
1
univaluado
> 1 multivaluado
Componente
Ingeniera de Software - Clase 6
82
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
... Agregacin: Caracterizacin
UNPSJB - 2005
No => inclusiva
Si => no inclusiva
Si => dinmica
No => esttica
83
Ejemplos
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
84
... Ejemplos
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
85
Ejemplos
Agregacin
Cuenta
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
1 contiene
Polgono
3.. *
{ordenado}
Persona
or
1
Punto
Asociacin excluyente
Empresa
Usuario
est-autorizado-en
Estacin
Autorizacin
prioridad
Clase de asociacin privilegios
UNPSJB - 2005
camb_privil
86
Clases y Objetos
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
87
Generalizacin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
88
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
La Generalizacin y
Especializacin son
equivalentes en
cuanto al resultado: la
jerarqua y herencia
establecidas
Generalizacin y
Especializacin no son
operaciones reflexivas
ni simtricas pero s
transitivas
89
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Vehculo
Veihculo Terrestre
Coche
UNPSJB - 2005
Camin
Vehculo Areo
Avin
Helicptero
90
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Funcionando
Estropeadoen UML:
Restricciones
predefinidas
UNPSJB - 2005
disjunta - no disjunta
total (completa) - parcial (incompleta)
91
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
Particionamiento del
espacio de objetos =>
Clasificacin Esttica
Particionamiento del
espacio de estados de
los objetos =>
Clasificacin Dinmica
En ambos casos se
recomienda considerar
generalizaciones/espe
cializaciones disjuntas
92
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Un ejemplo de Clasificacin
Esttica:
Vehculo Areo
{ esttica }
Avin
UNPSJB - 2005
Helicptero
93
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Un ejemplo de Clasificacin
Dinmica:
Coche
{ dinmica }
Funcionando
UNPSJB - 2005
Estropeado
94
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
int(A) int(B)
ext(B) ext(A)
B
UNPSJB - 2005
95
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Clasificacin Esttica
C0
ext(C0) = ext(Ci)
{ static }
completa
ext(Ci) ext(Cj) =
C1
UNPSJB - 2005
Cn
disjunta
96
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Clasificacin Dinmica
C0
ext(C0) = ext(Ci)
{ dinmica }
completa
C1
UNPSJB - 2005
Cn
no disjunta en
diferentes
instantes
97
... Generalizacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Militar
uso
Vehculo Areo
estructura
Avin
UNPSJB - 2005
Helicptero
98
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
99
Herencia Mltiple
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Cuadrpedo
nro patas
nro patas
Herbvoro
Con Pelos
comida
cubertura
Con Plumas
cobertura
Animal
comida
cobertura
Carnvoro
Con Escamas
Conejo
UNPSJB - 2005
100
Principio de Sustitucin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
101
www.dsic.upv.es/~uml
Principio de Sustitucin www.dsic.upv.es/~uml
UNPSJB - 2005
102
Polimorfismo
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
103
Polimorfismo
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
?
dormir
?
Len
UNPSJB - 2005
Oso
Tigre
104
Polimorfismo
Animal
dormir()
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Dormir()
{
}
Len
Oso
Tigre
dormir()
dormir()
dormir()
Dormir()
{
sobre el vientre
}
UNPSJB - 2005
Dormir()
{
sobrela espalda
}
Ingeniera de Software - Clase 6
Dormir()
{
en un rbol
}
105
Polimorfismo
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
106
Diagrama de Estados
UNPSJB - 2005
107
Diagrama de Estados
objetos con un
comportamiento
significativo
El formalismo utilizado
proviene de los
Statecharts (Harel)
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
108
Diagrama de Estados
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
109
Diagrama de Estados
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Estados y Transiciones
Evento [condicin] / Accin
B
Tanto el evento como la accin se
consideran instantneos
UNPSJB - 2005
110
Diagrama de Estados
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
en activo
perder empleo
jubilarse
jubilarse
jubilado
UNPSJB - 2005
111
Acciones
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
B
UNPSJB - 2005
112
Acciones
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
113
www.dsic.upv.es/~uml
Generalizacin de Estadoswww.dsic.upv.es/~uml
UNPSJB - 2005
114
www.dsic.upv.es/~uml
Generalizacin de Estadoswww.dsic.upv.es/~uml
Ejemplo:
e1
e2
e2
C
UNPSJB - 2005
115
www.dsic.upv.es/~uml
Generalizacin de Estadoswww.dsic.upv.es/~uml
Quedara como:
Aa
e1
b
B
e2
C
UNPSJB - 2005
116
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Generalizacin de Estados
Bb
e2
e0
C
UNPSJB - 2005
117
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Generalizacin de Estados
b
B
e2
UNPSJB - 2005
C
e0
118
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Generalizacin de Estados
UNPSJB - 2005
La agregacin de estados es la
composicin de un estado a partir
de varios estados independientes
La composicin es concurrente por
lo que el objeto estar en alguno de
los estados de cada uno de los
subestados concurrentes
119
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Generalizacin de Estados
Ejemplo:
e1
e1
UNPSJB - 2005
120
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Generalizacin de Estados
Ejemplo:
UNPSJB - 2005
121
Historia
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
122
Historia
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Ejemplo:
d2
B
in
D
out
d1
C
H*
UNPSJB - 2005
123
Historia
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Ejemplo:
Enjuague
Lavado
Secado
cerrar puerta
abir puerta
Espera
UNPSJB - 2005
124
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
La destruccin de un objeto es
efectiva cuando el flujo de control
del autmata alcanza un estado
final no anidado
La llegada a un estado final anidado
implica la subida al superestado
asociado, no el fin del objeto
125
Destruccin de Objeto
Ejemplo:
En vuelo
despegar
Crear(matricula)
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
crash
aterrizar
En tierra
126
www.dsic.upv.es/~uml
Transiciones temporizadaswww.dsic.upv.es/~uml
UNPSJB - 2005
127
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Transiciones temporizadas
Ejemplo:
/ Abrir ranura
esperar dinero
entry: Mostrar mensaje
exit: cerrar ranura
despus de
30 segundos
anular
transaccin
Depsito efectuado
B
UNPSJB - 2005
128
Diagrama de Actividad
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Un mtodo
Un caso de uso
Un proceso de negocio (Workflow)
129
Ejemplos
UNPSJB - 2005
130
... Ejemplos
UNPSJB - 2005
131
... Ejemplos
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
132
Diagrama de Componentes
UNPSJB - 2005
133
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Diagrama de Componentes
Los diagramas de
componentes describen
los elementos fsicos del
sistema y sus relaciones
Muestran las opciones
de realizacin
incluyendo cdigo
fuente, binario y
ejecutable
UNPSJB - 2005
134
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Diagramas de Componentes
Ejemplo:
UNPSJB - 2005
135
Diagrama de Despliegue
UNPSJB - 2005
136
Diagrama de Despliegue
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
137
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Diagrama de Despliegue
UNPSJB - 2005
138
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Diagrama de Despliegue
<<Servidor>>
<<TCP/IP>>
Base de
Datos
<<RDSI>>
Podemos distinguir
tipos de nodos y
connexiones por
estereotipado
UNPSJB - 2005
Control
<<RDSI>>
139
Proceso de Desarrollo de SW
basado en UML
UNPSJB - 2005
140
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Requisitos nuevos
o modificados
UNPSJB - 2005
Proceso de Desarrollo
de Software
No existe un proceso
de software
universal. Las caractersticas de cada
proyecto (equipo de desarrollo, recursos,
etc.) exigen que el proceso sea
configurable
141
Historia de RUP
Rational Unified Process
1998
RationalObjectory Process
1996-1997
Objectory Process
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Pruebas funcionales
Pruebas de desempe
Gestin de requisitos
Gestin de cambios y
configuracin
Ingeniera de Negocio
Ingeniera de datos
Diseo de interfaces
UML
1987-1995
UNPSJB - 2005
Enfoque Ericsson
142
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Dos dimensiones
UNPSJB - 2005
143
Inception Elaboration
Objetivos
(Vision)
Construction
Arquitectura
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Transition
Capacidad
Operacional
Inicial
Release
del Producto
tiempo
UNPSJB - 2005
144
Elementos en RUP
Workflows (Disciplinas)
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Workflows Primarios
Business Modeling (Modado del Negocio)
Requirements (Requisitos)
Analysis & Design (Anlisis y Diseo)
Implementation (Implementacin)
Test (Pruebas)
Deployment (Despliegue)
Workflows de Apoyo
Environment (Entorno)
Project Management (Gestin del Proyecto)
Configuration & Change Management (Gestin
de Configuracin y Cambios)
Ingeniera de Software - Clase 6
145
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Workers
UNPSJB - 2005
Artefactos
Actividades
146
Workers
Analyst workers
Business-Process Analyst
Business Designer
Business-Model Reviewer
Requirements Reviewer
System Analyst
Use-Case Specifier
User-Interface Designer
Developer workers
Architect
Architecture Reviewer
Capsule Designer
Code Reviewer
Database Designer
Design Reviewer
Designer
Implementer
Integrator
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Testing professional
workers
Test Designer
Tester
Any Worker
Course Developer
Graphic Artist
Stakeholder
System Administrator
Technical Writer
Tool Specialist
Manager workers
Other workers
147
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
148
Artefactos
Resultado parcial o
final que es producido
y usado durante el
proyecto. Son las
entradas y salidas de
las actividades
Un artefacto puede
ser un documento, un
modelo o un elemento
de modelo
Conjuntos de
Artefactos
Requirements Set
Analysis & Design Set
Implementation Set
Test Set
Deployment Set
Project Management Set
Configuration & Change
Management Set
Environment Set
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
149
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
150
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
151
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Proceso dirigido por los Casos de
Uso
Capturar, definir y
validar los casos de
uso
Requisitos
Anlisis & Diseo
Implementacin
Casos de Uso
integran el
trabajo
Verificar que se
satisfacen los
casos de uso
Pruebas
UNPSJB - 2005
Realizar los
casos de uso
152
trace
Caso de Uso
trace
trace
trace
Pruebas
Unitarias
Pruebas Funcionales
Caso de Prueba
[The Unified Software Development Process. I. Jacobson, G. Booch and J. Rumbaugh. Addison-Wesley, 1999]
153
UNPSJB - 2005
Ingeniera de Software - Clase 6
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
154
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Proceso Iterativo e Incremental
UNPSJB - 2005
155
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Las actividades se encadenan en una minicascada con un alcance limitado por los
objetivos de la iteracin
Anlisis
Diseo
n veces
UNPSJB - 2005
Codific.
Pruebas e
Integracin
Ingeniera de Software - Clase 6
156
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
157
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Enfoque
Cascada
Enfoque
Iterativo e
Incremental
UNPSJB - 2005
158
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
159
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Proceso
Centrado
en la
Arquitectura
Arquitectura
de un sistema
es la
organizacin o
Inception Elaboration
Construction
Transition
Architecture
UNPSJB - 2005
160
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
161
www.dsic.upv.es/~uml
...Fases del Ciclo de Vida www.dsic.upv.es/~uml
Elaboracin
UNPSJB - 2005
162
www.dsic.upv.es/~uml
...Fases del Ciclo de Vida www.dsic.upv.es/~uml
Construccin
UNPSJB - 2005
163
www.dsic.upv.es/~uml
...Fases del Ciclo de Vida www.dsic.upv.es/~uml
Transicin
UNPSJB - 2005
164
Elaboration
Construction
Transition
15%
Requisitos
Una iteracin en la
fase de elaboracin
Anlisis
10%
Diseo
15%
30%
Implementacin
15%
Pruebas
P re lim ina ry
Ite ra tion (s)
UNPSJB - 2005
ite r.
#1
ite r.
#2
ite r.
#n
ite r.
# n+ 1
ite r.
# n+2
ite r.
#m
ite r.
#m +1
165
Elaboration
Construction
Transition
Requisitos
Una iteracin en la
fase de elaboracin
Anlisis
Diseo
Implementacin
Pruebas
P re lim ina ry
Ite ra tion (s)
Esfuerzo:
Duracin:
UNPSJB - 2005
ite r.
#1
ite r.
#2
ite r.
#n
ite r.
# n+ 1
5%
20%
65%
Ingeniera de Software - Clase 6
10%
30%
50%
ite r.
# n+2
ite r.
#m
ite r.
#m +1
10%
10%
166
UML - ANEXO
Fundamentos del Modelado OO
Para evaluacin por parte de los
alumnos
UNPSJB - 2005
167
Objetos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
168
Objetos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Un Objeto
Otro
Objeto
UNPSJB - 2005
169
Objetos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Banco de Valencia
Felipe
Cuenta Corriente 114
UNPSJB - 2005
170
Objetos
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
171
Clases y Objetos
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
172
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Identidad
UNPSJB - 2005
173
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Identidad
UNPSJB - 2005
174
Estado
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
175
Comportamiento
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Ejemplo de interaccin:
176
Comportamiento
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
177
Persistencia
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
178
Comunicacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
179
Comunicacin
Categoras de objetos:
Activos - Pasivos
Cliente Servidores, Agentes
UNPSJB - 2005
180
Comunicacin
UNPSJB - 2005
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
181
Comunicacin
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
Sevidor 1
Servidor 2
Un cliente
UNPSJB - 2005
182
El Concepto de Mensaje
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
183
www.dsic.upv.es/~uml
El Concepto de Mensajewww.dsic.upv.es/~uml
Objeto 1
: Mensaje A
Objeto 2
: Mensaje C
: Mensaje E
Objeto 3
Objeto 4
: Mensaje D
UNPSJB - 2005
184
Mensaje y Estmulo
www.dsic.upv.es/~uml
www.dsic.upv.es/~uml
UNPSJB - 2005
185