Every time I begin writing and making my open source projects available I seem to always omit the licensing bit.
The GitHub team have created the below site to help[1]:
http://choosealicense.com/
You can easily find out more about which license to choose, in addition to the license text itself.
[1] - https://github.com/blog/1530-choosing-an-open-source-license
Saturday, July 20, 2013
Sunday, July 7, 2013
Aspect Interceptor With Castle Windsor C#
Purpose
- Show how to create an interceptor using Castle Windsor
- Describe when interceptors should be used
Code
An Interceptor
Intercepts the target, and then calls proceed
Windsor Registration
Initializes windsor, and then assigns the SimpleInterceptor as an implementation for IInterceptor.
Using an interceptor
By adding the interceptor attribute and making the method virtual. The TestClass's DoStuff() method will now be intercepted when the method is called and after the method has returned
Interceptors should be implemented to allow you to create a "Cross Cutting Concerns". The best example is logging. With logging you may want to know when a method was started and when it returned. When
Besides logging there are several use cases. One that I wrote recently was the ability to publish domain/events when a certain method was called. This allowed me to implement the domain business logic, and then to publish that event independently.
From a Single Responsibility standpoint this allows your class to do "One thing and do it well", but then allows you to independently spin off into different set of concerns.
Subscribe to:
Posts (Atom)