Thanks for the reply. That kind of makes sense, except that when using
our application the user must first select a company and then select a
delivery point to be able to raise an order (there could be many
hundreds of delivery points to search through). Within the domain this
is a hierarchical relationship so why would we not represent it that
way in the domain model?

Maybe it would be simpler to represent the relationship between the
user and the company/deliverypoint as a separate object type and have

Class User
    IList<UserCompany> AccessibleCompanies;


On Jun 10, 6:14 pm, Oskar Berggren <[email protected]> wrote:
> Had a keyboard malfunction... :-)
>
> Continuing:
> Consider having:
>   class User
>       IList<Company> AccessibleCompanies
>       IList<DeliveryPoint> AccessibleDeliveryPoints>
>
> Perhaps you don't even need AccessibleCompanies directly from the User?
>
> Company.DeliveryPoints is with this idea always all the delivery
> points for that company.
>
> /Oskar
>
> 2009/6/10 Oskar Berggren <[email protected]>:
>
> > Another point to be made is that you seem to have no actual
> > representation of the user-deliverypoint relation in your domain
> > model, only hidden in you db.
>
> > Consider:
> > class User
>
> > 2009/6/10 Fabio Maulo <[email protected]>:
> >> As a completely different representation of aggregation I think it should 
> >> be
> >> collections of "User" and without cascade on delete (the Parent-Child 
> >> should
> >> have cascade on delete).
> >> User
> >>   ISet<CompanyOfUser> Companies{get;set;}
>
> >> 2009/6/10 JamesSpibey <[email protected]>
>
> >>> My specific problem is that my customers are separated into
> >>> 'companies' and within each company there are multiple delivery
> >>> points. So for a given user, they will have access to one or more
> >>> companies and for each of those companies they will have access to one
> >>> or more delivery points. Should this be a property of the User object
> >>> (i.e. User.Companies & User.Companies(0).DeliveryPoints) therefore
> >>> allowing the collection to be easily modified and persisted back to
> >>> the database, or should it be represented in a different way?
>
> >>> Thanks again for your help
>
> >>> On Jun 10, 3:20 pm, Fabio Maulo <[email protected]> wrote:
> >>> > I don't know your domain... what I know is that a never need
> >>> > session.CreateFilter for a collection and, in general, I don't use
> >>> > "order-by" nor "where" as collection attributes.
> >>> > Probably you need some other class to represent the association between
> >>> > User
> >>> > and Parent or User is not associated to Parent but to some subClass...
> >>> > Try to think in the concept... The Parent has Children whatever is the
> >>> > association that Parent has the same Children...
> >>> > Well... I known... in the real life perhaps that Parent can say, in some
> >>> > special place, that he isn't married and he does not have children but
> >>> > you
> >>> > know... it is a lie.
>
> >>> > 2009/6/10 JamesSpibey <[email protected]>
>
> >>> > > So are you saying I should not try to map the 'Parent' collection into
> >>> > > my user object and instead retrieve it using a query/filter? Shouldn't
> >>> > > I be trying to compose my domain objects entirely using mappings
> >>> > > rather than issuing manual queries to retrieve the data?
>
> >>> > > On Jun 10, 2:53 pm, Fabio Maulo <[email protected]> wrote:
> >>> > > > 2009/6/10 JamesSpibey <[email protected]>
>
> >>> > > > > Thanks for the reply, much appreciated. Can you explain what you
> >>> > > > > mean?
> >>> > > > > Am I going about this the wrong way?
>
> >>> > > > Probably yes.
> >>> > > > Btw take a look to session.CreateFilter.
> >>> > > > Yo to reference and find(using browser find):  CreateFilterhttp://
> >>> > > nhforge.org/doc/nh/en/index.html
>
> >>> > > > --
> >>> > > > Fabio Maulo
>
> >>> > --
> >>> > Fabio Maulo
>
> >> --
> >> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to