Skip to content

Polymorphic Event Specification

Leon Starr edited this page Mar 22, 2022 · 7 revisions

An entity (anything capable of emitting a Signaling Event) may want to tell a bank account to close without regard to the particular type of account. But the activity that results may vary depending on the type. So we want the ability to send a generic ‘close’ Event, without knowledge of the target instance Subclass and yet have that Event processed by the appropriate Subclass Lifecycle State Model. This is accomplished by defining the generic event on a Superclass Lifecycle State Model, such as that for the example class Account. This event will then trickle down through one or more Generalizations to ultimately be resolved by activity defined in the appropriate Subclass Lifecycle.

In the following example from the book Models to Code, three Polymorphic Event Specifications Park, Pass, and Hitch load, are defined and applied to multiple delegated polymorphic Events.

An Event is defined on a Class playing the role of Superclass, but delegated through one or more Subclass Lifecycle State Models with a polymorphic event specification.

Identifiers

  1. Name + Class + Domain

Attributes

No non-referential attributes

Clone this wiki locally