You may not know it, but if you have been working with the Microsoft.Net platform for any length of time, there are numerous Design Patterns which have been implemented natively by the Microsoft.Net Framework.
Here are just some of the common Design Patterns:
So if someone ever asks you if you have ever worked with Design Patterns, you HAVE!
Here are just some of the common Design Patterns:
- If you have ever worked with creating a Collection and then looping through it using a foreach loop, you have used the Iterator Pattern.
- If you have ever used a StringBuilder to build strings (hence its name), you have used the Builder Pattern.
- If you have ever used Serialization of objects using XML Serialization attributes or DataContract Serialization attributes for WCF, you have used a form of the Decorator Pattern.
- If you have ever used Web Services (ASMX or WCF), you have used the Proxy Pattern.
- If you have ever worked with a static class constructor, you have used the Singleton Pattern.
- If you have ever worked with the DbFactory class in ADO.Net, you have used the Factory Method Pattern.
- If you have ever worked with DataBinding expressions in ASP.Net or just plain old XML, you have used the Interpreter Pattern.
- If you have ever written extension methods, you have used the Bridge Pattern.
- If you have ever worked with a SqlDataAdapter object, you have used the Adapter Pattern.
- If you have ever worked with a SqlCommand object, you have used the Command Pattern.
- If you have ever used the Copy or Clone methods on a DataSet, you have used the Prototype Pattern.
- If you have ever worked with Events (such as a Button Click event), you have used the Observer Pattern.
- If you have ever worked with templated controls in ASP.Net such as the Wizard control or the various ASP.Net AJAX Controls, you have used the Template Method Pattern.
- If you have ever worked with a State Machine Workflow in SharePoint, you have used the State Pattern.
- If you have ever worked with any of the various Providers such as MembershipProvider, RoleProvider, ProfileProvider or SiteMapProvider, you have used multiple Design Patterns:
- Strategy Pattern
- Factory Method Pattern
- Singleton Pattern
- Facade Pattern
So if someone ever asks you if you have ever worked with Design Patterns, you HAVE!
Great Explanation. Another great article i recommend is:
ReplyDeletethis
http://thecafetechno.com/tutorials/design-patterns/proxy-pattern-in-java
ReplyDelete