class - Create a design pattern for objects in two categories, both covering all objects -
i design class diagram following problem:
from 1 perspective in domain, elements ("elements") either input elements or output elements, not both.
from perspective, either nodes or arrows (but not both).
for example, element e1 can have 1 of following situations:
1) input node
2) output node
3) input arrow
4) output arrow.
i encode without using constraint (like ocl)
so far, i've come following design diagram (grey classes abstract):
my question: there more efficient pattern fit problem more accurately, without multi-inheritance?
with requirements , per understanding, i'd rather use strategy
pattern instead of inheritance. 2 different behaviors
- input/output
- node/arrow (could shape)
and element contain functions related 2 behaviors (as has both of these). diagram (the element referring ishapebehavior , iinputoutputbehavior)
Comments
Post a Comment