SSWUGtv
With Stephen Wynkoop
How do you know if your systems (and your data) are protected? How can you be sure? Patrick Townsend has the answers!
Watch the Show
Aspect Programming
I have been reading “Microsoft .NET: Architecting Applications for the Enterprise.” In this book I have been introduced to what is a new concept of programming to me called Aspect programming. It sure has promise for certain kinds of applications.
Aspect programming is where you write code performing a cross cutting purpose, and then weave that code into other programs. Kinds of aspect programs that could be written suggested by the author were Logging, Alerts, Error handling, counters, etc.
A weaving process is used to associate an aspect method to a method within your own program. It may look for keywords, or use a regular expression to decide if an aspect is defined to integrate with different parts of your code. So, you define weaving rules for the aspect engine.
The author writes of two kinds of aspect integration: pre-compile weaving, and post-compile weaving. Pre-compile weaving uses the rules to take your code and the aspect code, and merge it into new code. The merged code is then compiled into final executable code.
Post-compile weaving is done through a proxy. A proxy is built by reflecting your code and then weaving in the aspect calls. Instead of calling your code direct, the application will now call the proxy instead, resulting in the injection of the aspect code.
Post-compile aspects would be useful in those situations where you do not own the source code but wish to introduce new functionality.
Aspect programming techniques have only been around for a few years as a fairly new technology. Are you using them or tools that work in a similar fashion? Share your experience by writing btaylor@sswug.org.
Cheers,
Ben
$$SWYNK$$
Featured Article(s)
SQL Server 2012 XML Optimization Tips
In this article, you can find some tips to use xml in SQL Server 2012.
Featured White Paper(s)
Top 10 Tips for Optimizing SQL Server Performance
read more)