Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Named advice

Maybe naming advice is syntactic sugar and doesn't add much to the power of
the language, but I believe that it would add value to the human side,
which, if you think about it, is the true purpose of language.  I'm finding
as I write aspects that the pointcut names don't do much in helping describe
my advice.  It's somewhat distracting to have to search my comments to find
the advice that I'm interested in.  To me, it's the advice that's important
not the pointcuts.  Rules work very similarly... the conditions clauses are
similar to pointcuts while actions clauses are similar to advice.  The nice
thing about rules is that they are both tied up into a _named_ rule.  I
don't need to scan my rules' comments, conditions or actions to figure out
what any particular rule represents - I just look at the name of the rule.

Emotional and intelligence research shows that humans relate quickly and
easily with names but struggle (even if only slightly) when dealing with
concepts.  A study (I don't remember where I saw it) showed that remembering
a group of peoples' names and then recalling their careers was significantly
easier (more people were remembered and more careers were correctly
correlated with the person) than simply remembering individuals in the group
by their careers (fewer careers were remembered and fewer people were
correctly correlated with the career).

Personally, naming the advice (using a short // comment above it) allows me
to generalize the concept embodied by the advice so that I can formulate an
abstraction.  It allows me to hide the details and focus on the higher-level
abstracted idea.

I'm with Ron thinking that named advice would be helpful when annotating
code that is advised by an aspect - especially in an environment like
Eclipse.  Maybe it doesn't add to the processing capabilities, but it would
ease the strain of using and learning a new construct like aspects by tying
it to idioms that work with humans.

> -----Original Message-----
> From: aspectj-dev-admin@xxxxxxxxxxx
> [mailto:aspectj-dev-admin@xxxxxxxxxxx]On Behalf Of Gregor Kiczales
> Sent: Monday, August 18, 2003 2:20 PM
> To: aspectj-dev@xxxxxxxxxxx
> Subject: RE: [aspectj-dev] Named advice
>
>
>
> > What do you think of having metadata tags on advice? It seems
> > logical, and I assume it is possible to put metadata tags on
> > anonymous classes so it's analogous to something in Java. It
> > would also give a means of picking out advice elements.
>
> I'm sure we'll support that syntactically.  But I think it would
> be kludgy to then use the tags for some semantic effect in AspectJ.
>
> > Another possible use of named advice would be defining advice
> > precedence within an aspect, rather than using ordering in
> > the file. It would also facilitate tools support (so you can
> > pick the advice to see in a browser and can see the name of
> > the advice that affects something).
>
> We considered the above.  The former seems little to gain for a
> new language feature. The latter wasn't language semantics, so
> we didn't add names for it.
>
>
> > I don't feel that having an optional name for advice will add
> > much complexity. I can't suggest making it mandatory because
> > of backward compatibility. I do grant you that we have to set
> > a high bar to adding features to preserve simplicity.
>
> No single addition adds much local complexity.  But taken together,
> all the features project both a real complexity and an "apparent
> heft".
>
> Its clear that one of the common arguments against AspectJ is that
> it is "too big and complex". As you know, I think that argument is
> somewhat bunk.  We could and should address it by more clearly teaching
> that AspectJ has a kernel, and then things like extra join points and
> extra pointcuts are orthogonal.  But that argument is out there, and
> we need to keep it in mind.
>
> > For that matter, if we were willing to make incompatible
> > changes, I'd rename "after" advice to "after finally", so
> > it's more clear instead of confusing novices...
>
> For better AND for worse, we said a long time ago it was too
> late to make that change.  :)
>
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-dev
>



Back to the top