Blog

Filter posts by Category Or Tag of the Blog section!

Intruducing Aspect Oriented Programming

Monday, 12 August 2013

Aspect Oriented Programing(AOP) is a way of thinking about the program structure. AOP complements the Object-oriented programming but instead of classes in object-oriented programming, you deal with aspects in AOP. So what's an aspect? There is a great example here on defining the aspect. Imagine that we have a base class named Dog and we inherit another class named Poodle dog from this base class. Poodle is a kind of dog and that's why we can create an object for it. A dog is anyhow Poodle or not but what do you think about the Obedient dog? Obedient is a feature or an aspect that not every dog has it, right? So we can look to obedient as an aspect. It is behavior that should have structure, but there is no any way to express this structure in code with traditional object-oriented.

AOP has been for a long time but recently it gets more attention. AOP is all about encapsulating the crosscutting concerns, So what're the crosscutting concerns? you can imagine a cross-cutting concerns something like amount or metric. because it doesn't represent a specific thing, and it doesn't have a business rule. AOP is just a programming paradigm for increasing the modularity. So what's the Modularity? Modularity is class in OOP and aspect in AOP. It provides to abstract the cross-cutting code into a separate aspect and supports the modularization of concerns. AOP can be used with object-oriented programming and it complements object-oriented programming.

 

comments powered by Disqus