Bug 78615 - [ui] Show crosscutting in Editor and Outline based on concrete aspects
Summary: [ui] Show crosscutting in Editor and Outline based on concrete aspects
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.2.1   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 84030 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-15 09:48 EST by Matthew Webster CLA
Modified: 2007-10-23 06:26 EDT (History)
2 users (show)

See Also:


Attachments
Examples (2.03 KB, application/octet-stream)
2004-11-15 09:51 EST, Matthew Webster CLA
no flags Details
Example (2.04 KB, application/octet-stream)
2004-11-25 07:10 EST, Matthew Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Webster CLA 2004-11-15 09:48:21 EST
Currently AJDT shows cross-cutting based on the aspect that defines the advice 
(which may be abstract) rather than the (concrete) aspect that implements it. 
This is misleading. The attached projects show 2 examples where this is 
problematic.

Example 1:

Project1 defines an abstract aspect which is extended and made concrete in 
Project2. The Editor view for project2.HelloWorld attributes cross-cutting to 
the abstract aspect but neither the Outline view for the abstract nor the 
concrete aspects shows any cross-cutting. The Visualiser views are empty.

Example 2:

Project3 defines an abstract aspect and 2 concrete sub-aspects. All views 
attribute the cross-cutting of project3.HelloWorld to the abstract aspect and 
misleadingly hide the duplicate advice in the 2 concrete sub-aspects.

In each example cross-cutting should be attributed to concrete aspects and all 
concrete aspects should appear in the Visualiser.
Comment 1 Matthew Webster CLA 2004-11-15 09:51:59 EST
Created attachment 15858 [details]
Examples
Comment 2 Mik Kersten CLA 2004-11-18 16:08:27 EST
Let's tackle Example 2 first.  I've set those sources up as a test case in 
AspectJ since this will involve changes there.  Let me know what you think of 
adding the following relations:

  abstract pointcut scope();
  -> concretized by
    - ConcreteAspect1.scope(): ...
    - ConcreteAspect2.scope(): ...

And then the back links will be called "concretizes".  We can not 
show "advises" links for pointcuts, because pointcuts don't cause advice to 
execute.  So this would make it possible to navigate that structure without 
violating that constraint.

Let me know if that would work, and if it could result in a sensible UI for 
the Visualiser.
Comment 3 Matt Chapman CLA 2004-11-22 09:26:39 EST
Yes, I believe we need the "concretizes" relationship, although if anyone has
suggestions for a nicer name, I'd like to hear it!
Comment 4 Mik Kersten CLA 2004-11-22 17:49:52 EST
I just double-checked with Gregor and we believe that there is no better name 
for that concept.  I believe that it will be obvious enough for programmers 
especially since it will appear in conjunction with the keyword "abstract".

I'll take this on, and move it to AspectJ since it will be implemented in the 
ASM.  Once that's done we can have a discussion on how this should surface in 
AJDT.  One idea is that we add an Outline filter button that toggles the 
visibility of the "uses pointcut" and "concretizes" relations.  If might 
prototype that alongside the change, in which case I'll raise a seperate 
enhancement report.
Comment 5 Matthew Webster CLA 2004-11-23 04:08:12 EST
This is not really what I had in mind for the Visualiser. It shows the 
relationship between Aspects and types. It is not concerned with pointcuts. It 
is my understanding that types are cross-cut by concrete aspects not abstract 
ones even if that is where advice is declared. The situation may be slightly 
different for gutter annotations and the outline view which shows the 
relationship between join points and advice as well as advice and pointcuts. 

I would like to see a tree view in the Visualiser Menu showing aspect 
relationships (parent->child) and the bars in the Visualiser View using the 
colour associated with the _concrete_ aspect rather than and abstract one. If 
advice/pointcuts are actully declared in an abstract parent the tree view 
facilitates navigation.
Comment 6 Matt Chapman CLA 2004-11-23 09:49:34 EST
Two issues have come out of this:
1. Showing the concretizes relationship in the editor and outline view, to allow
nagivation between abstract and concrete aspects in the editor/outline view.
2. What to show in the visualiser, where we want to show the higher level
relationship between aspects and classes. Here it probably makes more sense for
the source of the relationship to be the concrete aspect rather than the
abstract aspect is it is currently.

So let's leave this bug for item 1, and I've raised bug 79283 for item 2 (which
may itself require ASM changes, but is really a separate issue).
Comment 7 Mik Kersten CLA 2004-11-23 12:25:24 EST
Yes, let's have this bug deal with (1) alone.  But I'll address Matthew's 
point (2) here as well.

I understand why this can be a desirable way of looking at how 
abstract/concrete aspects affect the system.  However, we need to be very 
careful here about how the tools communicate the semantics of the language.  
First, types are not crosscut by aspects, just as types don't call types.  
Advice crosscuts dynamic join points.  That advice is contained by an aspect, 
and the shadows of the join points may be contained by a file.  The Aspect 
Visualiser does a somewhat strange thing by grouping all of the advice in a 
single aspect, but this grouping let's you think more abstractly about advice 
so it's a useful thing.

What you are proposing is to change this grouping of advice to be something 
much more complex, by conceptually moving the advice from the abstract aspect 
onto each of the concrete aspects.  Keeping in mind our important decision 
that pointcuts do not show up as "affects" links in the structure model, since 
they have no behavioral effect on the system.  So on first examination I'm 
guessing that this proposal will cause a mismatch between what the tool shows 
and the aspect inheritance semantics of pointcuts and advice.  

What would be useful is if you could come up with a small example of when this 
structure results in the Visualiser links being more useful and more clear 
about the crosscutting structure.  Please make sure to include more than one 
concrete aspect in the example  
Comment 8 Matthew Webster CLA 2004-11-25 06:53:09 EST
My grasp of AOP terms is still maturing ;-). An aspect is the modularization 
of a cross-cutting concern. The Visualiser illustrates how that concern cross-
cuts your application (either the hand-coded form through declare 
error/warning and the AO implementation through pointcuts & advice or ITDs). 
Its primary purpose is to help verify the correctness of your aspects both as 
they relate to the application and each other. It is also a good way to 
determine what aspects affect you system. Currently it doesn't do this 
properly because it doesn't show aspects that inherit all their advice.

If I have 2 concrete aspects the Visualiser should look the same regardless of 
whether those aspects share a common super-aspect or not. It should show me 
whether the implementation is correct: are there gaps or overlap. Where the 
advice is declared is not important.
Comment 9 Matthew Webster CLA 2004-11-25 07:10:37 EST
Created attachment 16128 [details]
Example

The Visualiser should show SubAspect1 and ConcreteAspect1 in the same way
because the implement the same cross-cutting. Also for SubAspect2 and
ConcreteAspect2. Merely showing AbstractAspect hides the fact that there are 2
separate concerns.
Comment 10 Mik Kersten CLA 2005-02-03 12:31:53 EST
*** Bug 84030 has been marked as a duplicate of this bug. ***
Comment 11 Adrian Colyer CLA 2005-03-23 08:59:15 EST
We really need to get AJDT as solid as possible. this is a good issue to resolve
in aj5m3 timeframe.
Comment 12 Andrew Clement CLA 2005-08-24 10:08:55 EDT
*no* chance for m3
Comment 13 Adrian Colyer CLA 2005-10-28 05:36:56 EDT
We're not going to hold 1.5.0 for this, but will make it a top priority for post 1.5.0. Given that the use case 
for this is AJDT, that should still mean that we can surface this function to end users ahead of the 1.5.1 
release of the compiler if we need to.
Comment 14 Andrew Clement CLA 2006-04-04 14:06:46 EDT
some thinking on this the other day came up with us having no idea what to do .. didnt make 1.5.1 ;)
Comment 15 Helen Beeken CLA 2006-10-19 06:23:39 EDT
Just as a note.....any work done in this space needs to be extended to the faulted in model for injar aspects (see bug 145963, bug 160469 and ShadowMunger.createHierarchy()).