Interface oriented is something like having contract-based approach, means whatsoever be there under the Contract you have to implement all of it. A good example of this is : WCF.

Object oriented is based on

1. abstraction – which means making things loosely coupled so that in future they can be easily handled without affecting the system.

2. encapsulation(data hiding) – categorizing data as per their role i.e private, public, etc.

3. inheritance – provides the real world genetic mechanism as what’s there in the parent would be there in the child too(or not).

4. and polymorphism – means same look and feel but different functional abiltity.

Aspect oriented programming can be done either on Interface oriented or an Object oriented code. It can not exist alone.  AOP is another method of reducing the redundant code and its impact.  Let’s see an example:

You have a class ResultGraph in a Stock Application, which has say 5 methods (like MethodA, MethodB, MethodC, MethodD, UpdateGraphics). 

Assume that just after a method (say, MethodX) is executed, the stock price changes – hence the graph needs to be re-rendered. In such case, UpdateGraphics needs to be called.  Which means all 5 functions will call UpdateGraphics.

This appears to be simple since the number of functions is less. In a real time scenario, there are 100’s of methods and implementing this becomes tough.

AOP enables doing it in an easier manner.  We write something like:-

after() : set() {   

pointcut set() : execution(* set*(*) ) && this(StockClass) && within(*);

The first code means, whenever any set is called, call ResultGraph.UpdateGraphics()

The second code interprets as,

if a method is named set*:(* means any name might follow after set), regardless of what the method returns (first asterisk) or what parameters it takes (third asterisk) and it is a method of StockClass and this class is part of the package “*”, then this is a set() pointcut. And our first code says “after running any method that is a set pointcut, run the following code”.

I hope now the difference is clear…