I've been reading about a new programming paradigmn to accompony OOP (Object-Oriented Programming). It's called Aspect Oriented Programming. So far, it looks pretty interesting. The idea behind it is to make object code cleaner. It doesn't replace OOP as much as accompany it. It uses a program called a weaver to convert an AOP language to an OOP language which is then interpretted by the compiler.
AOP involves creating special functions called aspects. These are specialized functions called before and after a specific function. It's re-using certain code, such as access checking for various different functions. Here's a pseudocode example:
before BankAccount(idNumber)
{
if ( !VerifyAccountID(idNumber) )
{
print("Invalid account number");
terminate;
}
}
BankAccount Withdraw(idNumber, amount)
{
accounts[idNumber].balance-=amount;
print ( amount + " withdrawn.");
}
BankAccount Deposit(idNumber, amount)
{
accounts[idNumber].balance+=amount;
print ( amount + " deposited.");
}
This pseudocode has two specialized functions of type BankAccount. Before each function is called, the "before" function is called to verify that the idNumber is correct. The idea on Aspect-oriented programming is to re-use access checking functions.
There's an AOP binding for C++ called AspectC++ (http://www.aspectc.org/). It supports weaving together code for the GNU compiler, and MS Visual C++.
What do you all think about AOP? Do you think a plugin supporting AspectC++ or another weaver would be a useful addition to Code::Blocks? I want to generate some discussion on this.