code prole


coding for the proletariat since 1977


I’ve been aware of Aspect Oriented Programming (AOP) for some time now, but I haven’t ever really looked into it. My current project team is angling for an architectural decision that would allow us to use the Spring framework for transaction management. In reading about Spring and experimenting with some sample code I’ve discovered that it is really an implementation of AOP.

Simply put, AOP seeks to address common aspects of objects across the layers of your application. Object Oriented Programming (OOP) allows us to model our applications after real world objects, making them easier to design, develop, and implement. However, there are some aspects of the real world that apply to multiple objects. When translated into source code these aspects often end up repeated in multiple objects. And we all know what happens when you start repeating code.

Take logging for example. Any application that has a logging requirement is likely to have calls to a logging service scattered through out the various layers of the application and the numerous objects comprising that layer. Wouldn’t it be better if the objects just focused on the business task at hand, while the logging was handled in a separate framework? That’s what AOP is all about. Every object in the application that requires logging services shares an aspect: the need for logging. Using AOP techniques and tools allows the application objects to be tightly focused on the business requirements, while the cross-cutting aspects are addressed through AOP.


Filed under: Aspect Oriented Programming

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: