[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] AspectJ and memory management
|
> These accessor methods should be in StateBlock, and having to
> duplicate the methods in the aspect for the purpose of delegating
> is not ok.
Well its certainly easy to put them in state block instead if you
want. What do you really want? Have them in StateBlock, in the Aspect?
Both?
> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx
> [mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Rickard Öberg
> Sent: Wednesday, August 11, 2004 7:19 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] AspectJ and memory management
>
> Gregor Kiczales wrote:
> >>Anyway, Wes and I resolved the terminology issues off-list and it
> >>appears what I want to do can't be done in AspectJ.
> >
> > I thought the following code, that we exchanged mail about
> last night,
> > does do what you want. In what way doesn't it work?
> >
> > /*
> > * Here's an aspect that associates a lot of extra state with
> > * some target type. But we want to be sure not to allocate
> > * all that storage unless we really need it. So we use a
> > * lazy allocation strategy for it.
> > */
> > abstract aspect PersistenceOrSomething {
> >
> > protected interface HPoS {}; //marker type
> > //stands for
> HasPersistenceOrSomething
> >
> > private static StateBlock {
> > private Mumble mumble;
> > private Frotz frotz;
> > ...<many more fields>...
> > StateBlock() { /*appropriate initialization*/ }
> > }
> >
> > private StateBlock Target.state = null;
> >
> > /* these are the accessor methods for the state */
> > public Mumble HPoS.getMumble() { return state.mumble; }
> > public Frotz HPoS.getFrotz () { return state.frotz; }
> > ...<many more accessors>...
>
> These accessor methods should be in StateBlock, and having to
> duplicate
> the methods in the aspect for the purpose of delegating to it
> is not ok.
>
> /Rickard
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>