• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1251
  • Last Modified:

Have you used Design Pattern (C#) in your project?

One of my interview questions was 'Have you used Design Pattern (C#) in your project?'. Though I've used only singleton pattern so far in my project I was managed to explain that alone. I've read more articles to explain other patterns theoretically. But he wanted to explain the scenarios and patterns with code.

If you have used design pattern in your projects please do explain the scenario you used and please do provide your code. So that I could get better idea.

Thanks.
0
Easwaran Paramasivam
Asked:
Easwaran Paramasivam
  • 3
  • 3
  • 2
2 Solutions
 
TI2HeavenCommented:
Please check this nice guide.
0
 
TI2HeavenCommented:
I do not recommend this link but I am sending to you because I know for other questions you asked that you are interested in an example of Entity Framework with other design patterns.
0
 
Easwaran ParamasivamAuthor Commented:
Experts,

 I'm looking for practical usages of Design pattern in your project. So that I could know better.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
Jaime OlivaresSoftware ArchitectCommented:
Well, there are many situations where you implicitly use patterns:
- For example, most GUI libraries are based on some specific patterns, like MVC and MVVM.
- WCF may enforce you to use some specific patterns, as described in the article pointed by TI2Heaven.
- Also there are lots of Factory pattern usages in the .net library.
- If you have implemented your own interface you are already using a pattern

So, it is almost impossible not to use a pattern. Just review a pattern list like Gang-of-Four's and try to relate them with your own experience.
0
 
Easwaran ParamasivamAuthor Commented:
Thanks. Your points make sense. What I'm looking for is that where we do explicitly create/use design pattern. In which situation we use which pattern? In any of your projects if you implemented explicitly please do explain in detail. If sample code there, then that would be great.
0
 
Jaime OlivaresSoftware ArchitectCommented:
Well, in that case, if somebody ask you in an interview: have you used design patterns? then you should answer honestly: No, I haven't.
What's the point of asking for other's experience?
Regarding examples, that's very easy to google:
http://www.google.com/search?q=DESIGN+PATTERN+EXAMPLES
0
 
Easwaran ParamasivamAuthor Commented:
Thanks.
0
 
TI2HeavenCommented:
They are great answers Jaime, both of them!.
I would like to add some of my thinking about this topic.
You are not a greater programmer if you just follow these patterns, and ask you which one fits better in each particular case. I have readied I few books about software architecture (Gang-of-Four's is in my must read queue) and I don’t see this patterns as the perfect guide to make good programs a see this patterns as a way to question your programming style and a way to question the need of your favorite language structures (c#). So, Yes to study all design patterns but No to follow them as the bible.
Knowing about other language environment is also profitable because you will see different options taken in language design (C++, Java, Net Language, SQL language, JavaScript, SVG, …).
Design Patterns assume that a good general purpose language is enough to program anything. I am not agree with the previous sentence, to program the sprinkles of your back yard, general purpose language is not the language best suited in doing it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now