Discussions

General J2EE: AspectJ in J2EE

  1. AspectJ in J2EE (1 messages)

    I am new bee to AspectJ. I had a requirement of improving our existing logging mechanism by adding "Method Entered ..", "Method Exited .." statements in all public methods of the application.

     Since Most of the AspectJ examples are about acheiving a similar thing by writing some advices on pointcuts, I thought it might be a good idea to use AspectJ in this case.

     I have a couple of questions regarding the same and any help is greatly appreciated.

     Since the logging statements will never be part of the java source code, How easy is it to debug based on the log statements? I might search the entire source for that particular log statement which i wont find.

     How good is it , to keep adding these kind of adivises outside the source which is difficult to maintain and understand by new comers to existing projects ?

    Thanks
     Kiran
  2. AspectJ Cencern[ Go to top ]

    hi,
    Yes Aspect-J has some learning curve,but not too hifg as corba.
    But it provides loose coupling between component as you are removing
    logging concern from source code.This makes it more plug gable and reusable.