I could do with some advice on how to go about architecting the following using a module-view(-presenter) architecture using unity and prism.
The main module's purpose is to edit, say a Line. The Bootstrapper initializes a LineModule, which registers a LineView into a region on the Shell called "LineRegion".
Its data will also be stored in and manipulated by a LineModel.
So far so good.
The Line, however, is described by a Start and and End. Now the Start and the End are complex data structures (say, a Point) in themselves and need their own controls for editing them.
So, these want to also conform to the MVP architecture, so I will have a PointModel, and a PointView.
However, I am a bit lost as to how to arrange these with respect to the Line view.
Firstly I am presuming it would be nonsensical to define a PointModule? Since the Point editing functionality is a sub-function of the Line editing functionality...?
The 'holy grail' if you like, would be to have it so that:
* the LineView can define regions called "StartPoint" and "EndPoint", and
* into each of these will be loaded a PointView,
* each PointView which will be instantiated by the unity container, thus creating for each one a PointModel automatically which it takes in its constructor
* ... but each PointModel will be able to be referred to by the LineModel!
does that make sense?!
Is this possible?! ;-)
Will any regions I define in the LineView be picked up by the region manager and in what section of code should they be registered with their respective PointView?
Also how would I go about making two PointModel objects available to the LineModel, such that the LineModel can refer to StartPoint and EndPoint individually?
public class LineModel : ILineModel
private IPointModel startPoint;
private IPointModel endPoint;
the important thing is that it needs to refer to each of them, not just have an arbitrary collection of them - so it needs to have a reference to each one.
Thanks for any help, much apprecated