Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Aspectj scope Singleton, moitoring ?

On Tue, Dec 29, 2009 at 9:40 AM, prg@xxxxxxxxxxxxxxx <prg@xxxxxxxxxxxxxxx> wrote:
... 
Regarding Aspects, there is only one general advice I can give, based on
my experience: You should be reluctant to do implementation-level stuff
from Advice. It is always better to invoke an API or an existing service.
(And following this reasoning, locking and managing the state would be
the service's job, not the job of the aspect).

Cheers,
Hermann V.

That is indeed a good advice (no pun intended). In general, it is best if aspects do minimal work by themselves. Essentially, I like aspects to act as controllers and forward implementation details to normal objects (often injected dependencies). Besides taking care of issues such as concurrency (essentially, by making them nothing special than in the OO-only world), such an arrangement facilitates better testing of the overall implemenation.

-Ramnivas 

Back to the top