3:00pm Chris Scott - Introduction to Aspect Oriented Programing with ColdSpring
Aspect Oriented Programing (AOP) gives you a way to apply cross cutting concerns to a wide area of your object model. Eg Logging, security and similar.
You can work declaratively, rather than procedurally.
For example remove the cflog statement from multiple places in your code and use AOP to introduce the functionality of logging throughout your code. It does this by intercepting the method calls. These are called "Join Points" in AOP.
"Introduction" allows code to be added before, after, during and around any method call to a CFC. We call this "advising".
You extend "Advice classes" to do this. You are able to do this at the following points:
BeforeAdvice,
AfterReturningAdvice,
AfterThrowingAdvice,
AroundAdvice.
This is similar to the decorator pattern. The Decorator adds functionality and calls the original method, to do the main part of the work.
To use decorator for logging you would have to manually create multiple decorators and swap them for each of the existing calls.
AOP offers Dynamic Proxy Generation. A proxy is created to add the functionality. ColdSpring creates the proxy object and add the advice classes. The process is called "weaving". A class called an advisor is a build tool for the proxy factory.
The aspect is created and Target Object is passed to the ProxyFactoryBean to create the new object. Since it extends your object you can use the generated object just like your own.
The Lightpost sample application shows the way this can be used.
An aspect is a way to think about an abstract system. AOP gives tools to allow those abstract systems to be incorporated into your system.
Metadata can be used to configure the abstract system. CF metadata can be extended by use of Additional attributes which are added to the cffunction tag to extend the metadata, for each method.
This can allow the same aspect functionality to be shared between a CF app and a Flex app.
There will be an article on Adobe.com about this very soon and the LightPost examples will be available by the end of the month.
There is a good article by Barney Boisvert about adding metadata to objects and using it in ColdSpring.
There is good robohelp documentation at www.coldspringframework.org.


originally posted it on the next day (because I was in washingston and my
server is in th UK) and I changed the date. Its seems the dates are cached
because a restart of CF fixed it!