Re: wondering ...

roger menday <[email protected]> Wed, 25 Feb 2004 12:26:21 +0100
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
Thanks, that's very helpful !=20

... as a continuation of this question, suppose I wanted to achieve a
similar functionality with picocontainer. I want to use a 'aggregated
component', which declares in the constructor it's individual
components. The methods in these individual components should operate on
state stored in the main component. Is it possible to gain access to the
state of the 'parent' component in picocontainer ? Am I confusing things
here ?!?

I am viewing the composite components as Mixins to the main aggregating
component. Then, I would like to use picocontainer as a lightweight
holder of currently running instances of the 'aggregated component'
service.=20

Which is the best path for this, nanning, picocontainer, a combination
of both ?=20

Thanks,=20

Roger

On Wed, 2004-02-25 at 11:45, Jon Tirs=C3=A9n wrote:
> Sure, that is common if you use mixins a lot. There's
> a simple way of doing it in Nanning:
> (MainObject) Aspect.getThis()
>=20
> To explain:
> If you have a mixin MyMixin and a main object
> MainObject then in MyMixin you can do Aspect.getThis()
> which will return you the currently executing proxy.
> You can cast it both to MyMixin and MainObject.
>=20
> It's possible in for example Dynaop too but the
> mechanics are slightly different.
>=20
> Hope this helps,
> Jon
>=20
>  --- roger menday <[email protected]> skrev: >=20
> > Hi,=20
> >=20
> > Although, I am new to nanning (and AOP generally),
> > recently I have read
> > quite a bit, but cannot sufficiently answer one
> > particular question ::
> >=20
> > I thinking how Mixins might help my coding ::  it
> > seems to me that the
> > Mixin would be useful (even without the AOP
> > functionality), but I might
> > need the Mixin to have access to the state of the
> > object is it being
> > MixedIn to. Is this something that is usual/
> > supported, or am I barking
> > up the wrong tree ?=20
> >=20
> > Roger
> >=20
> >=20
> > _______________________________________________
> > nanning-dev mailing list
> > [email protected]
> >
> http://lists.codehaus.org/mailman/listinfo/nanning-dev
>=20
> H=C3=B6strusk och gr=C3=A5 moln - k=C3=B6p en resa till solen p=C3=A5 Y=
ahoo! Resor p=C3=A5 adressen http://se.docs.yahoo.com/travel/index.html
> _______________________________________________
> nanning-dev mailing list
> [email protected]
> http://lists.codehaus.org/mailman/listinfo/nanning-dev
>=20