RE: some questions about the 0.3 / 0.4 codeline

"Jon Tirsen" <[email protected]> Tue, 6 May 2003 22:36:56 +0200
Newsgroups gmane.comp.java.nanning.devel
Message-ID <000701c3140f$400ee9d0$6c4a59d5@jon>
I think adding the classIdentifier in the interfaces list might be
alright. I try to add that to CVS as soon as possible.

MixinInstance and AspectInstance marked final is probably an
optimization or an indication that they should not be extended. I don't
think I did that actually, it might be some of my co-workers.

The whole AspectSystem thing is still quite experimental. If I remember
correctly MixinAspect adds a mixin to an AspectInstance if the
interfaceClass matches the classIdentifier. You probably need to write
your own Aspect that adds mixins based on what interfaces the
classIdentifier extends. You'll probably see a lot of changes in the
AspectSystem-area in the future.

> -----Original Message-----
> From: [email protected] [mailto:nanning-
> [email protected]] On Behalf Of Steve Conover
> Sent: Friday, May 02, 2003 8:58 PM
> To: [email protected]
> Subject: RE: [Nanning-developer] some questions about the 0.3 / 0.4
> codeline
> 
> Jon,
> 
> I went ahead and added this line to
AspectInstance.getInterfaceClasses:
> 
> interfaces.add(classIdentifier);
> 
> Does this violate conceptual integrity at some fundamental level, in
> your opinion?  Anyway all my tests run now.
> 
> Also, just out of curiousity, why are AspectInstance and MixinInstance
> marked final?
> 
> By the way, I tried converting over to using MixinAspects - but I
> notice when I instanciate the an aspectInstance, and process those
> aspects, and then do a getProxy, when I inspect the proxy in the
> debugger the mixin list is empty.  Which makes me think I'm missing
the
> point of MixinAspect -- what's it for?
> 
> Regards,
> Steve
> 
> --- Steve Conover <[email protected]> wrote:
> > Hmmm yah I thought of that, but the problem is this - my
> > "classidentifier" is something like
> >
> > interface User extends Identifiable, HasAlias, HasEmailAddress, etc
> > ,etc
> >
> > where each one of the exteneded interfaces is a mixin.  But when I
> > make
> > the User interface itself a mixin, the calls to methods that I'd
> > rather
> > be routed to the finer-grained mixins go to the User interface,
which
> > has no implementation.
> >
> > Maybe a solution would be to have two levels of proxies - at the
> > "top"
> > is the User interface mixin only, and then I feed in the other set
of
> > mixins as its target.  Of couse that set of mixins wouldn't
implement
> > interface User, so I'd probably run into problems.
> >
> > I really like the idea of being able to construct a "virtual" object
> > piece by piece like this...is there any harm in sticking the
> > classIdentifier in that mixin list?  After all, if I remember
> > correctly
> > it's a Set, so it's not like you'd ever have two of those interface
> > classes if you decided to put a mixin in there as well.
> >
> > Regards,
> > Steve
> >
> > --- Jon Tirsen <[email protected]> wrote:
> > > Neat.
> > >
> > > That serves mainly as an identifier of what "class" the instance
> > > belongs
> > > to. Don't you have a mixin that also has this interface as
> > interface?
> > > If
> > > not what target implements the interface passed in as identifier?
> > >
> > > > -----Original Message-----
> > > > From: [email protected]
> > > [mailto:nanning-
> > > > [email protected]] On Behalf Of Steve
Conover
> > > > Sent: Friday, May 02, 2003 2:12 AM
> > > > To: [email protected]
> > > > Subject: RE: [Nanning-developer] some questions about the 0.3 /
> > 0.4
> > > > codeline
> > > >
> > > > I've been doing some converting today to MixinAspects (I really
> > > like
> > > > the new config system, very clean).  My AspectFactory returns an
> > > > AspectInstance from the newInstance(class) method.
> > > >
> > > > I do an AspectInstance.getProxy() and try to cast it to the
> > > interface
> > > > class I fed into the AspectInstance constructor, but I get a
> > > > classcastexception.  I notice in the code to construct a proxy
> > the
> > > only
> > > > interfaces fed into the Proxy.newProxyInstance are from the
> > mixins.
> > > >
> > > > Why isn't the interface class I passed into the AspectInstance
> > > > constrctor also included?
> > > >
> > > > Regards,
> > > > Steve
> > > >
> > > > --- Jon Tirsen <[email protected]> wrote:
> > > > > Yeah, you should probably try to move away from the
> > > > > c.t.n.definition-classes. The AspectInstance/MixinInstance has
> > a
> > > > > similar
> > > > > API although you'll find it to be more flexible. The main
> > > difference
> > > > > is
> > > > > that you'll need to create a new AspectInstance for every
> > > instance
> > > > > you
> > > > > create and then invoke getProxy() to get the proxy for this
> > > instance
> > > > > only. But I guess you've got a factory somewhere where this is
> > > done
> > > > > in a
> > > > > central place (if not, I suggest you do that :-).
> > > > >
> > > > > The new c.t.n.config-stuff is not really ready and a lot of
> > > things
> > > > > will
> > > > > probably happen there. The main purpose is to have
> > > Aspect/J-semantics
> > > > > in
> > > > > Nanning where cross-cutting concerns are truly modular, ie.
> > > mixins
> > > > > and
> > > > > interceptors are tied together into a single aspect. There's a
> > > > > description about it here:
> > > > >
> > > >
> > >
> >
>
http://sourceforge.net/mailarchive/forum.php?thread_id=1621907&forum_id=
> > > > > 12937
> > > > >
> > > > > I'm using it myself and it's very powerful, but it's not very
> > > > > well-documented and kind of weird sometimes. If you want to
use
> > > it I
> > > > > can
> > > > > answer questions you may have.
> > > > >
> > > > > (c.t.n.definition-classes is in fact implemented on top of the
> > > > > AspectInstance stuff.)
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: [email protected]
> > > > > [mailto:nanning-
> > > > > > [email protected]] On Behalf Of Steve
> > > Conover
> > > > > > Sent: Wednesday, April 30, 2003 10:55 PM
> > > > > > To: nanning-developer
> > > > > > Subject: [Nanning-developer] some questions about the 0.3 /
> > 0.4
> > > > > codeline
> > > > > >
> > > > > > Jon,
> > > > > >
> > > > > > I'm just integrating the 0.4 codeline into my project, and
> > had
> > > a
> > > > > few
> > > > > > questions.
> > > > > >
> > > > > > My aspects are still working due to this code in
> > > > > > AspectDefinition.checkObject:
> > > > > >
> > > > > > if (target == null) {
> > > > > >             return;
> > > > > >         }
> > > > > >
> > > > > > However I still would like to provide a target that doesn't
> > > > > implement
> > > > > > the interfaceClass, as we discussed earlier.  That's not
> > really
> > > > > > possible via the AspectDefinition.
> > > > > >
> > > > > > I remember you said something about extending MixinInstance
> > > (which
> > > > > I
> > > > > > notice is final).  However I guess I haven't been keeping up
> > > with
> > > > > > changes very well - what are the purposes of these new
config
> > > > > classes
> > > > > > (Pointcut, Advise, MixinAspect, etc)?
> > > > > >
> > > > > > I'm defining these AspectDefinitions, and then building up
an
> > > > > > AspectClass and instanciating that to create my objects.
> > > Should I
> > > > > be
> > > > > > moving this stuff to MixinXXX?
> > > > > >
> > > > > > Regards,
> > > > > > Steve
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------------
> > > > > > This sf.net email is sponsored by:ThinkGeek
> > > > > > Welcome to geek heaven.
> > > > > > http://thinkgeek.com/sf
> > > > > > _______________________________________________
> > > > > > Nanning-developer mailing list
> > > > > > [email protected]
> > > > > >
> > https://lists.sourceforge.net/lists/listinfo/nanning-developer
> > > > >
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This sf.net email is sponsored by:ThinkGeek
> > > > > Welcome to geek heaven.
> > > > > http://thinkgeek.com/sf
> > > > > _______________________________________________
> > > > > Nanning-developer mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/nanning-developer
> > > >
> > > >
> > > > =====
> > > > *****************
> > > > Steve Conover Jr.
> > > >
> > > > Verify chainmail here: http://www.snopes.com
> > > > *****************
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This sf.net email is sponsored by:ThinkGeek
> > > > Welcome to geek heaven.
> > > > http://thinkgeek.com/sf
> > > > _______________________________________________
> > > > Nanning-developer mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/nanning-developer
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:ThinkGeek
> > > Welcome to geek heaven.
> > > http://thinkgeek.com/sf
> > > _______________________________________________
> > > Nanning-developer mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/nanning-developer
> >
> >
> > =====
> > *****************
> > Steve Conover Jr.
> >
> > Verify chainmail here: http://www.snopes.com
> > *****************
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Nanning-developer mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/nanning-developer
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nanning-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nanning-developer



-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com