song library app root, switchable, child? Csla.net 2.0

song library app root, switchable, child? Csla.net 2.0

Old forum URL: forums.lhotka.net/forums/t/379.aspx


kids_pro posted on Wednesday, June 14, 2006

Hi all,

I am still confusing how to implement the following use case.
My sample app is song library with the following hierachy:
Production has many albums, an album has many songs.

Is it correct if I implement it as follow:
+ Production: BusinessBase<Production> - parent
   + Albums: BusinessListBase<Albums, Album> child
      + Album: BusinessBase<Album> switchable object
         + Songs: BusinessListBase<Songs, Song>
            + Song: BusinessBase<Song> - grand child

Please advice.
Kids



DavidDilworth replied on Thursday, June 15, 2006

Kids,

What exactly is your use case (i.e. the question)?  All you've given is an object hierarchy (i.e. the solution).  You need to ask a better question to get some help.

David

kids_pro replied on Thursday, June 15, 2006

David,

I am not sure if I implement it correct or not with the Album object as a switchable object.

Thanks,
kids

guyroch replied on Thursday, June 15, 2006

A switchable object simply means that your object can be instantiated as a root object in one case and as a child objectr in another case.

If this is your only need for Album, then there is not need for a switchable object.  Remember, a switchable object usually mean a bad design.

Like David asked, what are your use cases?



Copyright (c) Marimer LLC