Reply To: OOA '20 Questions: Polymorphic Events

homepage Forums Executable UML and xtUML Methodology OOA '20 Questions: Polymorphic Events Reply To: OOA '20 Questions: Polymorphic Events

Lee Riemenschneider

As many of you have seen before, I don’t believe polymorphic events are real in Shlaer-Mellor. I think the only reason they came into existence is because the process models (action languages) allow selection of supertype instances. Supertype instances don’t really exist in Shlaer-Mellor. All instances of objects are members of a subset, which is drawn as a class (improper subsets) or a supertype-subtype hierarchy (proper subset).
As I wrote here, “I think the mistaken view of super/subtyping as a relationship is what causes such invalid concepts like polymorphism and having to formalize a super/subtype relationship to enter the Shlaer-Mellor model space.”
In BridgePoint OAL, all events are directed at instances, but selection of an instance can often involve navigating the supertype relationship to see if a subtype exists. This becomes very tedious, so polymorphic events sound like a good idea. As Sean describes above, ASL (and MASL) direct events at objects/classes. This means every member of the set has to handled the event. (The hierarchy priority Sean described sounds like further super/subtype relationship dementia.)
H.S. Lahman and I had a lengthy discussion about broadcast vs targeted events in the now-gone Yahoo! Executable UML group. I don’t remember if Lahman was advocating an object-level broadcast or a domain-wide broadcast (which would require every event label in a domain to be unique), but I think we agreed that every object instance could decide if it needed to handle the event. If you were to support object-broadcast events, you would also remove the need for polymorphic events as every event would be defined at the object level, and available to all subtype state model segments (a term to use if you consider spliced state model to be a good thing (I do!)).