Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Detecting methods being called in the execution of another method



Am I right in thinking that you have 2 separate concerns: 1) that a close()
is always called in the same method as open/create() and 2) that a
particular code fragment is used to close the connection. One approach
would be to refactor the desired close logic into a separate method.
AspectJ can than be used to ensure the connection manager is only ever
called from this new method, never directly from any other part of the
application. This is equivalent to putting your advice in the class.

>I'd like to implement in a more aspect oriented style, but
>there is no management approval ...
I completely understand the situation. We are in a transition period where
AOP is becoming very useful but the tools, processes and organization
haven't caught up yet.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Back to the top