views:

38

answers:

0

Hello All,

I have few questions here

In an ordering system I am considering Order as Aggregate Root OrderLineItem belongs to Order.

I can Ship the order to a End Customer or a Reseller Reseller can combine OrderLineItem from different orders and create a new Order and send to End Customer.

While creating new order (from other orders) I guess the only way I can select orderLineItem is if they have a distinct identity

1) Does this mean that OrderLineItem is entity and not a value item.

2) Can I get OrderLineItem Collection outside the Aggregate

Order.GetByID(123);

ICollection orderLines1 = Order.GetOrderLines(); Order.GetByID(456); ICollection orderLines2 = Order.GetOrderLines();

ICollection reconstructedOrderLines= Select necessary order lines from UI ;

and then

//create New order

Order.CreateNew(); Order.AddOrderLineItem(reconstructedOrderLines);

Does this break DDD AggregateRoot pattern.

3) Can a entity be part of more than one Aggregate Root.

Ex. a) Reseller Aggregate Root --> ResellerLocations

b)

ResellerLocation --> EndUsersLocation

c)

EndUserLocations --> Users

Users exist for a given EndUSerLocation, EndUsersLocation cannot exist without any ResellerLocations, ResellerLocation cannot exist without Reseller.

The reason I dont want to do

Reseller ---Aggregate Root --> ResellerLocations ---->EndUserLocation ------> Users This makes for complex graph and big transactional boundry/ context.

if I break it as in a,b,c is it against DDD.

When I add a User I care only about the enduserlocation not not any object up in graph.

Thank you in advance. Mar