Saturday, May 26, 2012

Extension Methods

In my last project, I used extension method to attach Validate() methods to business objects. I justified this because the business objects where serializable data transfer objects and will be used in diffrent domains as they where general ecommerce entities such as product, customer, merchant etc. Well in diffrent domains the business rules may be diffrent as well so I encapsulated my late bound validation logic in a Validate method attahced to the base class of my data transfer objects.
Athens - http://stackoverflow.com/questions/487904/what-advantages-of-extension-methods-have-you-found

No comments:

Post a Comment