Yes, it can get very complicated. That's people choose to use tools that
have already done all this work for you instead of reinventing the wheel.

On Wed, Feb 11, 2009 at 2:29 AM, Henry <[email protected]> wrote:

>
>
> > > 2.  If the child object is shared by more than 1 parent, should the
> > > parent all reference to the same instance of the child object?  If so,
> > > how?
> >
> > > Possible implementation:
> > > - Storing a struct of child objects by ID in Application scope?  That
> > > sounds bizarre and wrong
> > > - Factory pattern with cache layer??
> >
> > > If not, then the updated child might be overwritten by an old child by
> > > another parent object. e.g.
> > > Parent A @ init'ed, has copy of Child1, Child1.name = "ONE"
> > > Parent B @ init'ed, has another copy of Child1, Child1.name = "ONE"
> > > Parent A update Child1's name to TWO
> > > Parent A save (Child1 saved, Child1.name == TWO)
> > > Parent B save (Child1 saved, Child1.name == ONE)
> >
> > Yes, there should only be one instance of the same concrete object at a
> > time, or you'll run into a storm of synchronization issues. Which means
> some
> > central cache is required to ensure duplicate objects are not created.
>
> How would I implement that "central cache"?  Factory with cache
> layer?  How to determine how many objects to cache?  Do I need to
> implement a stack of Most Recently Used objects in CF? wow, this is
> really getting complicated.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" 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/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to