How to design this class hierarchy?
- by devoured elysium
I have defined an Event class:
Event
and all the following classes inherit from Event:
AEvent BEvent CEvent DEvent
Now, with the info I gather from all these Event classes, I will make a chart. With AEvent and BEvent, I will generate points for that chart, while with CEvent and DEvent I will paint certain regions of the chart.
Now, how should I signal this in my class hierarchy?
Should I make AEvent and BEvent inherit from PointEvent while CEvent and DEvent inherit from RegionEvent, being that both RegionEvent and PointEvent inherit from Event?
Should I add a field with an Enum to Event with 2 values, Point and Region, and each of the child classes set their value to it?
Should I use some kind of pattern here? Which one?
Thanks.