I have to create a domain for the energy transmission field, so I have Breaker, Transformer, Line, Cubible, Busbar, Source.
I'm trying to search for a domain implementation that conform to this specification:
CubiclecontainsBreakerandTransformerBreakerandTransformerandSourcehave to be connected each other withLineCubiclecontains one or moreBusbarBreakersinsideCubiclemust be interconnected with aBusbarBreakercan have max of twoLine/Busbarconnected (one for each side)Transformercan have max of two/threeLine/Busbarconnected (one for each winding)Sourcecan have max of oneLineconnected- I have to propagate the
Energizedstatus between elements soLine,BusbarandTransformerreceive the status ofEnergizedand generate it's ownEnergizedstatus, Breaker can transfer theEnergizedstatus only ifStatus==Status.Closed
With this rules I have created my domain that fullfil each rule, BUT
I don't have a complete tree... I have to create Breakers, next I create a Busbar with List<Breaker>, next I create a cubicle and insert the Busbar in List<Busbar>.
But when I come to Nhibernate mapping... all fails because I have multiple reference between objects and objects must be created in particular order in order to connect to events and permit Energized status propagation.
Any idea?