En UML, ¿la máquina de estado de un objeto define el ciclo de vida del objeto?

In UML, does an object's state machine define that object's lifecycle?

That is, do transitions from the estado inicial to an ordinary state create the object, and transitions to the estado final dispose of that object?

preguntado el 08 de noviembre de 11 a las 17:11

1 Respuestas

Generally yes - at least that's probably the most common way of using them.

It's not mandated that way in the UML spec; it allows a more general use of state machines. For example, a Final State can be used to signify the end of a behaviour thread within a region if the state machine has >1 regions. Or a state machine can be used to define a protocol instead of an object's lifecycle.

Some variants (profiles) of UML do enforce the behaviour you describe, for example UML ejecutable.

I'd probably turn the question on its head and ask: would it be useful to you if the state machine did define the object's lifecycle? If so then just use it that way. If you need to formalise then you podría define a profile. But it's equally fine to just agree informally in your team.


respondido 09 nov., 11:00

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.