Examples of GoF design patterns in .net

Possible duplicate:
What are the native built-in C # design patterns?


C # Design Patterns

I got inspiration from this question. I thought it would be nice to have examples in .net , as in a link.

If someone can give such details, it simply improves understanding of design patterns and makes them choose the best design pattern for the problem.

I am looking for examples from a base class library . If the moderators feel that if this is not an answer or off topic, please let me know that I will delete it.

+4
source share
3 answers

Most people seem to have ignored the β€œbase class” note in your question; take a look at this: http://msdn.microsoft.com/en-us/magazine/cc188707.aspx

+2
source

Just google for "gof.net"

Here are some of the first results:

http://www.dofactory.com/Patterns/Patterns.aspx

http://www.codeproject.com/Articles/3130/Illustrated-GOF-Design-Patterns-in-C-Part-I-Creati

The first link is very good:

To give you a start, C # source code is provided in two forms: "structural" and "real world". Structure code uses type names as defined in the template definition and UML diagrams. Real world code provides real programming situations in which you can use these patterns.

The third form, Optimized .NET, demonstrates design patterns that use the built-in features of .NET 4.0, such as generics, attributes, delegates, object and collection initializers, automatic properties, and reflection. These and more are available in our Pattern Framework 4.0TM design. See Our Singleton Page for .NET 4.0. Optimized code sample.

+2
source

Most OOP design patterns are language agnostics, so you can usually port a concept to C # VB.NET, etc.

I found this site very useful.

I also found that the Head First Design Patterns book is really useful, the ideas stick because they use simple, clear examples of the real world, and they cross it with pictures: 0). The examples are in Java, but C # is far from different.

+2
source

Source: https://habr.com/ru/post/1398832/


All Articles