VOOZH about

URL: https://www.javacodegeeks.com/2015/03/create-your-own-aop-in-java.html

⇱ Create your own AOP in Java - Java Code Geeks


Introduction

As you know AOP is one of the best features provided by Spring framework which provides utmost flexibility while achieving cross cutting concerns. Have you thought of how AOP works in Spring ? Sometimes this is the question asked in case of senior level technical interview. Sometimes this question becomes more significant when it comes to only core java. Recently one of my friend went to attend the interview and he faced an embarrassing question about how to use AOP only in core java without using Spring and related libraries. In this article I will provide you an outline about how to create your own AOP only in core java of course with certain limitations. This is not a comparative study between Spring AOP and Java AOP. However you can achieve AOP in java to certain extent using proper design patterns.

👁 Photo of Debadatta Mishra
Debadatta Mishra
March 4th, 2015Last Updated: March 2nd, 2015
3 497 1 minute read

Debadatta Mishra

I am working as a Technical Architect at JDA Software. I have more than 7 years of industrial experience in the field of Java, XML, Web services, Cloud and Banking and Financial and Logistics domain. I have contributed many articles on Java in internet sites.
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Comments
Oldest
Newest Most Voted
Tom De Greyt
11 years ago

If you have an interface and implementation, you can simply apply the decorator pattern to the same effect, without the need for proxies and reflection.

0
Reply
Debadatta Mishra
11 years ago
Reply to  Tom De Greyt

You are correct Tom, we can also achieve using Decorator Pattern, I have written a template being inspired by Spring AOP template formatting.

0
Reply
Syed Abuthahir
8 years ago

Simply great Deba

0
Reply
Back to top button
Close
wpDiscuz