1.5x Collections for multiple Parent Object relations

1.5x Collections for multiple Parent Object relations

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


esteban404 posted on Thursday, May 18, 2006

I don't know exactly how to explain this, so here is the first round:

I have a project that joins together at least two object types ObjA and ObjB. Each one needs a collection of hyperlinks to internal resources. I'm trying to make the collection as generic as possible, but as children, they need to know their parents. I definitely want to load the collection with the project without another db call.

Right now I have a root and collection class for each of the starting points. They store the Guid (from ObjA, ObjB...), DocumentID, Document Description, Created Date, CreatorID and CategoryID. The Guid is the id for the projects, everything else is pretty standard for all links.

Problem: the are initialized independantly of eachother for workflow reasons, so I can't say ObjB uses ObjA always or vice versa. No "build on this" scenario would fit.

What would be a mechnism to use to create the link so the lusers won't resent using the app?

_E

Q Johnson replied on Thursday, May 18, 2006

>> but as children, they need to know their parents <<
 
Perhaps this is an unnecessary restriction?  The parent isn't going to be making any changes to these hyperlinks are they?  They might as well be a read-only list, right? 
 
If so, you could consider making the hyperlinks a Public ROOT Collection object.  You can make it filterable, of course, and when an object of ClassA uses it, they could just build a Private Clone of it (shouldn't be another db call, right?) and filter by the projecct guid of ObjA - same for Obj B.  Then the list is always initialized and ready for whoever needs it.
 
If there really is a need for the "parent" object to make changes to these children, this won't be a useful idea, of course.


From: esteban404 [mailto:cslanet@lhotka.net]
Sent: Thursday, May 18, 2006 2:07 PM
To: QJohnson@TeamNFP.com
Subject: [CSLA .NET] 1.5x Collections for multiple Parent Object relations

I don't know exactly how to explain this, so here is the first round:

I have a project that joins together at least two object types ObjA and ObjB. Each one needs a collection of hyperlinks to internal resources. I'm trying to make the collection as generic as possible, but as children, they need to know their parents. I definitely want to load the collection with the project without another db call.

Right now I have a root and collection class for each of the starting points. They store the Guid (from ObjA, ObjB...), DocumentID, Document Description, Created Date, CreatorID and CategoryID. The Guid is the id for the projects, everything else is pretty standard for all links.

Problem: the are initialized independantly of eachother for workflow reasons, so I can't say ObjB uses ObjA always or vice versa. No "build on this" scenario would fit.

What would be a mechnism to use to create the link so the lusers won't resent using the app?

_E




esteban404 replied on Thursday, May 18, 2006

I think there is need for the parent to make the changes as the links directly relate to it. I think I may need to create a constructor internal to them all so I can pass the parent identity when it exists. That would work in a couple places, but not all.

A situation is a Setup Project can be initiated, but then the Designers get involved. How to get the design project to use the same links? What I've done thus far is use a "new Design" event inside the SetupProject editor (I've discovered my users love clicking things and pop up stuff). That's the only way I could think of using it. I've asked the designers if that's OK, but they balked. It's a coder/user issue I'm sure. I'll put together a demo and get their feedback. I think it could work fine.

I'll just give it a couple of days while working on GUI skutt work and i'll I'll get it if I have to take a couple of users down with me! :-]

Thanks for the reply, Q

_Sn

Copyright (c) Marimer LLC