caching object ?
- From: gabriel <spam@xxxxxxxx>
- Date: Wed, 03 Aug 2005 10:37:55 +0200
greetings,
I'm developping an application and am thinking about the following problem :
instance A needs instance B and C.
instance D needs B and C
instance E needs C
now I could do the following : create A and feed him B, C create D and feed him B and C or feed him A (since A holds B,C) create E and feed him A(since A holds B,C) or C only.
this creates dependencies so, having read about spring and IOC but not willing to use it (because I didn't managed to make spring work under dotnet in fact :) ).
I did this :
create some container which will contain A,B,C,D,E this container will give a reference to himself to each of the objects.
now, whenever any object need any object, he just uses the reference contained in this.container.
The point is the following :
the container can contain objects which are totally useless to some objects : E doesn't care about B for example.
I'm quite happy with this thing becase, I do not have complex dependencies of my objects : they all depend of one object only, the container.
what are your remarks about this ? (I am still young to OOP :) )
But
.
- Follow-Ups:
- Re: caching object ?
- From: H. S. Lahman
- Re: caching object ?
- From: Mark Nicholls
- Re: caching object ?
- From: Nick Malik [Microsoft]
- Re: caching object ?
- From: JXStern
- Re: caching object ?
- Prev by Date: Re: Test first as specification
- Next by Date: Re: OO Design induces an existential crisis
- Previous by thread: defining quality of OOA and OOD models
- Next by thread: Re: caching object ?
- Index(es):