Programming Help by Programmer's hub

Aspect Oriented programming

An Aspect is a common feature or behavior that act like it have a structure, But in actual you can’t find out a way to express that structure in the code. Aspect is a feature of programming language that typically scattered across methods, classes, object hierarchies, or even entire object models. Aspect oriented programming is different from the Object Oriented programming and provide another the way of thinking for program. The key unit of modularity in the Object oriented programming is the classes but in the Aspect oriented programming the key unit of modularity is Aspects. Aspect oriented programming provide the feature of crosscutting it's a behavior that "cuts" across multiple points in your object models, yet is distinctly different.

Aspect oriented programming language code example

public class BankAccountDAO
{
  public void withdraw(double amount)
  {
    long startTime = System.currentTimeMillis();
    try
    {
      // Actual method body...
    }
    finally
    {
      long endTime = System.currentTimeMillis() - startTime;
      System.out.println("withdraw took: " + endTime);
    }
  }
}

 

Implementations of Aspect oriented Prorgamming

  • .NET Framework languages (C# / VB.NET)
  •  ActionScript
  •  Ada
  •  AutoHotkey
  • C / C++
  • The Cocoa Objective-C frameworks
  • ColdFusion