views:

28

answers:

0

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:

  1. Cubicle contains Breaker and Transformer
  2. Breaker and Transformer and Source have to be connected each other with Line
  3. Cubicle contains one or more Busbar
  4. Breakers inside Cubicle must be interconnected with a Busbar
  5. Breaker can have max of two Line/Busbar connected (one for each side)
  6. Transformer can have max of two/three Line/Busbar connected (one for each winding)
  7. Source can have max of one Line connected
  8. I have to propagate the Energized status between elements so Line, Busbar and Transformer receive the status of Energized and generate it's own Energized status, Breaker can transfer the Energized status only if Status==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?