Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Spacewar example

Hi Dragan,

Re: #1, check to make sure that AspectJ is the default editor for .java file
extensions (window | preferences | file associations). Using .aj as the
extension for AspectJ source is now preferred, but Spacewar predates that.

Re: #2, sometimes a (static) inner aspect is a good choice. If some concern
crosscuts just a single class, or a general aspect is applied to just a
single class, it can be quite helpful. Ramnivas wrote some good articles on
TheServerSide about refactoring with AOP that are a good illustration.
Another common use case is in applying virtual mock objects for testing to a
specific test case. And in the space war code, take a look and ask whether
the inner aspects are helping modularity or not. Aspects are a modularity
technology, they aren't always oblivious, i.e., you can write a system where
the base code is aware of and interacts with aspects and you can also write
one where the aspects implement core functionality that is required.

Re: #3, often you will want to do some refactoring to address this. You
might find that some of the members apply to the crosscutting concern and
should be inter-type declarations. In a last resort, you can make an aspect
privileged to do exactly what you asked, but that's usually not the right
answer.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Matic, Dragan
Sent: Thursday, April 21, 2005 3:35 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Spacewar example

Hello,

I am pretty new in your community, so please don't be too hard to me if
I say something wrong, or if there is something you've already
discussed...
Looking at the spacewar game sample code, I was surprised to see that :

1/ in my IDE (eclipse 3.0, ajdt1.1.2), the java editor doesn't recognize
aspect keywords, if they are used in a class file (eventhough, there 
is no error shown in the tasks list)

2/ there are inner aspects declared in java classes ! That's shocking.
My understanding of the AOP philosophy, was that aspects are separated
from a java project; they should only describe an additional "aspect" of
the project; they should not make the code unclear, etc.

3/ as I tried to separate myself aspects from java classes, I got the
problem that my aspects can not access private fields declared in the
aim class; is there any way to solve that ?

Regards,
Dragan
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users





Back to the top