Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Issues while using AspectJ for logging

Hi,
      Thanks for the reply. Yes, i agree that refractoring can help to improve  the design. But my real problem with AspectJ is bit different. There are situations where we may need to log certain business logic. For eg., After manipulating some variable we may need to log the state of the variable. Currently i am not able to find any solution for this problem. is there any solution for this problem in AspectJ ?
 
Also, I am trying to use AspectJ in RCP Application which has lot of eclipse plugins. But, I am facing dependency problems. If any of you have used AspectJ in RCP applications or know any article on using AspectJ based logging for RCP Applications, i would greatly appreciate your help
 
Thanks & Regards
Prasanna L.M
 
 View my site
        @
 


----- Original Message ----
From: Dean Wampler <dean@xxxxxxxxxxxxxxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Sent: Friday, October 5, 2007 6:33:28 PM
Subject: Re: [aspectj-users] Issues while using AspectJ for logging

Presanna,

The best (and maybe only) solution is to refactor the code to extract each of those "points" into separate methods, then log the entry to and exit from each of those methods. Not only will refactoring solve this particular logging problem, but your overall design will be improved by the decomposition of large methods into small methods (http://wiki.java.net/bin/view/People/SmellsToRefactorings).

Of course, depending on the code base, that might be a lot of work, but the Eclipse and IntelliJ refactorings make it easy to do.

Good luck,
dean

On Oct 5, 2007, at 1:10 AM, Prasanna LM wrote:


 Hi,
      I am using AspectJ for the logging concern. I am able to add the log statements (entering & exiting) for all the public methods and also in exception cases. But, there are lot of other log statements inside the methods, which i want  add using the aspects. I am not able to find a solution for this using aspectJ. This is one of the main requirement, if i want to separate the logging concern from main business logic.
 
can any body help me to solve this problem ?
 
Regards
Prasanna
 


Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.
_______________________________________________
aspectj-users mailing list

Dean Wampler, Ph.D.
dean at objectmentor.com
See also:
http://aquarium.rubyforge.org     AOP for Ruby
http://www.contract4j.org         Design by Contract for Java5

I want my tombstone to say:
  Unknown Application Error in Dean Wampler.exe.
  Application Terminated.
      [Okay]        [Cancel]






Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

Back to the top