Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Practices regarding aspects

Hi Balaji,

I go with option 1, which ensures the best expository order for my code. Some 
times it makes sense to just separate a class into a class and three associated 
aspects in the same package, some times it makes sense for crosscutting aspects 
to go in their own place.

For example, in a graphics system I'd put all of my drawing code in the same 
place. Regardless if the classes I'm modifying belong to different packages or 
not. While for a logging aspect, I might want to keep it and the data-structures 
it uses strictly in its own package.

-Macneil

> Hello all,
> 
> When designing an application containing aspects which affect a number of 
classes (some in the one
> package, some spread across packages), what is the best/common practice?
> 
> 1. Make no distinction between aspects and classes when placing them in 
packages. i.e., place
> aspects where you feel..
> 
> 2. Place all aspects affecting that particular package (and its sub-packages) 
in its own package.
> That is, all aspects that affect java.util.regex are placed in 
java.util.regex.aspects. And all
> aspects affecting java.util (and all of its subpackages) in java.util.aspects. 
[I used aspects in
> a small application (~70 classes and 2 aspects) in this fashion.]
> 
> 3. Place all aspects of an application in a separate package, with a package 
structure
> corresponding to the packages it affects. Like aspects.java.util, 
aspects.java.util.regex. [I use
> this for JUnit tests - test.java.util, test.java.util.regex.]
> 
> Technically all of the above may be equivalent (barring 
visibility/accessibility issues). The
> potential issues are design clarity, code clarity, maintainability, separation 
of
> code-responsibility and other such software development concerns. What are you 
people doing? How
> are you placing aspects?
> 
> Please post your thoughts / comments.
> 
> Thanks,
> Balaji
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top