Hi,
I’m developing a graphical editor using PureMVC in which one can create “pages’ with different kind of “page items”. These page items share some properties like position, dimension. I simply created a concrete VO class for each of them which hold the properties of them. Similarly, there is a corresponding VC for each page item which renders its visual appearance based on the current property values. In the course of implementation every time I added an object it involved a lot of repetitive coding. (VO, Proxy, Meditator…) and I had a gut feeling that if my domain model could mirror the shared properties than I could have saved myself a lot of boring coding.
I figured that this would involve building an inheritance hierarchy instead of having concrete VOs. So I would have PageItemVO abstract class with (x,y,width,height) and ButtonVO that extends PageItemVO and adds the “label” property. This approach would make a dozen of Mediators unnecessary since some of them are only interested in position and dimension properties.
Would this be a viable approach? It just sound weird to me since all application I had a chance to look at used simple, concrete VO classes.
Any suggestion, comment is highly appreciated.
Thx,
Laszlo