CopyPastor

Detecting plagiarism made easy.

Score: 0.9089192282629094; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2017-11-18
by kensai

Original Post

Original - Posted on 2017-11-18
by kensai



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You are looking for single use case, while I was infront of handling multiple cases especially to reduce source code base on my latest project... and I found shining stuff in form of Aspect Oriented Programming -> AspectJ in Java world.
You can find very nice articles here: http://www.yegor256.com/2014/06/01/aop-aspectj-java-method-logging.html
You can implement the behaviour with custom annotation or simply hard-link it into your application, so you don't need to specify nothing in the code and each event will be autologed with specific behaviour (log with/without data, etc.).
Another very nice example of doing this is here: http://www.baeldung.com/spring-performance-logging
Just to add, same as you log events, you can create AspectJ auto logging in case of error handlers.
Not only this, but you can handle in fully generic way across whole application all errors in unified way by not writing simple line of code in error/event handlers...
NOTE: do not reinvent wheel, so look here as other people collected usefull AOP to be reused in your project out of the box :-)) open source is great community: https://github.com/jcabi/jcabi-aspects

You are looking for single use case, while I was infront of handling multiple cases especially to reduce source code base on my latest project... and I found shining stuff in form of Aspect Oriented Programming -> AspectJ in Java world.
You can find very nice articles here: http://www.yegor256.com/2014/06/01/aop-aspectj-java-method-logging.html
You can implement the behaviour with custom annotation or simply hard-link it into your application, so you don't need to specify nothing in the code and each event will be autologed with specific behaviour (log with/without data, etc.).
Another very nice example of doing this is here: http://www.baeldung.com/spring-performance-logging
Just to add, same as you log events, you can create AspectJ auto logging in case of error handlers.
Not only this, but you can handle in fully generic way across whole application all errors in unified way by not writing simple line of code in error/event handlers...
**NOTE:** do not reinvent wheel, so look here as other people collected usefull AOP to be reused in your project out of the box :-)) open source is great community: https://github.com/jcabi/jcabi-aspects

        
Present in both answers; Present only in the new answer; Present only in the old answer;