Home » Tag Archives: Aspect Oriented Programming

Tag Archives: Aspect Oriented Programming

Applying aspect oriented programming

spring-interview-questions-answers

1.Introduction The main target of the aspect oriented programming is the separation of cross-cutting concerns. When we talk about cross-cutting concerns we are referring to generic functionality that is used in several places in our system or application. These concepts are, among others:         Logging Transaction management Error handling Monitoring Security The way to achieve this separation ...

Read More »

Clean code with aspects

aspectj-logo

In my previous post I’ve described the alphabet conversion, and I’ve mentioned that we used AspectJ to resolve that task, but i did not mention how AspectJ works and what are aspects generaly. So in the next few lines i will explain: what is Aspect Oriented Programming and why we need it what is AspectJ using AspectJ with Spring (configuring ...

Read More »

Spring – Adding AOP support

aspectj-logo

I heard a story about one senior (and quite highly paid) softwaree engineer. He was given task to log every method in every controller in project he was working on. Engineer rewrote all controller methods, so from code like this: @RequestMapping(method = RequestMethod.GET) public String showEmployees(Model model) { List<Employee> employees = employeeDao.list(); model.addAttribute('employees', employees); return 'employees/list'; } he made following ...

Read More »

AOP made easy with AspectJ and Spring

aspectj-logo

I recently started looking at Aspect Oriented Programming (AOP) and I’m finding it exciting to say the least. Of course I was acquainted with it, since I saw it used for transaction management within Spring but I have never looked at it in depth. In this article I want to show how quick it is to get up to speed ...

Read More »

Implementing Active Record Pattern with Spring AOP

aspectj-logo

During class design we should take decisions about the assignment of responsibilities that will have every class. If we have chosen well, systems tend to be easier to understand, maintain and extend. Almost all of our projects have a persistence layer, either relational database, document stores, or simply XML files. And typically you will use DAO pattern to implement abstract ...

Read More »

Spring Pitfalls: Proxying

aspectj-logo

Being a Spring framework user and enthusiast for many years I came across several misunderstandings and problems with this stack. Also there are places where abstractions leak terribly and to effectively and safely take advantage of all the features developers need to be aware of them. That is why I am starting a Spring pitfalls series. In the first part ...

Read More »

Java EE6 Decorators: Decorating classes at injection time

java-logo

A common design pattern in software is the decorator pattern. We take a class and we wrap another class around it. This way, when we call the class, we always pass trough the surrounding class before we reach the inner class. Java EE 6 lets us create decorators through CDI, as part of their AOP features. If we want to ...

Read More »

Practical Introduction into Code Injection with AspectJ, Javassist, and Java Proxy

aspectj-logo

The ability to inject pieces of code into compiled classes and methods, either statically or at runtime, may be of immense help. This applies especially to troubleshooting problems in third-party libraries without source codes or in an environment where it isn’t possible to use a debugger or a profiler. Code injection is also useful for dealing with concerns that cut ...

Read More »

Aspect Oriented Programming with Spring AOP

spring-interview-questions-answers

Aspect Oriented Programming (AOP) refers to the programming paradigm which isolates secondary or supporting functions from the main program’s business logic. AOP is a promising technology for separating crosscutting concerns, something usually hard to do in object-oriented programming. The application’s modularity is increased in that way and its maintenance becomes significantly easier. The most prominent example of a crosscutting concern ...

Read More »

Aspect Oriented Programming with Spring AspectJ and Maven

aspectj-logo

Spring framework comes with AOP support. In fact, as stated in Spring reference documentation, “One of the key components of Spring is the AOP framework. While the Spring IoC container does not depend on AOP, meaning you do not need to use AOP if you don’t want to, AOP complements Spring IoC to provide a very capable middleware solution. AOP ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.