Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am developing a desktop application using C#. I want to use design patterns but do not have any experience in using them. I searched in net but can not found any good examples helpful for me like beginners. They have some block of codes to demonstrate the design patterns but I can not understand how can I use them when I develop my applications.
## How can I implement design patterns when developing real life applications, please can anyone guide me e.g. desktop application with C#
## Can we use design patter with sql code too?
Posted

1 solution

This question makes very little sense. The demonstration of just one or two implementation of the patterns will hardly help you. You did not give us any reasons to use one or another patters. And demonstration of big number of them would be hardly feasible and won't make any sense at all. After all, you already found some "block of codes to demonstrate the design patterns", and it did not help you, so why would some more sample help? I doubt it.

I think you are just trying to move in wrong direction. Or perhaps you are trying to break through the open door. First thing you need to understand is: implementing of some design patterns cannot be one of the goals of your project. In other words, design patterns are described to help some of your project, but the project should not be designed to implement design patterns. Don't swap the goal of you work and the tools helping you in your work.

Here is what reasonable people usually do with design patterns:

First, they try to design the software system, starting from the architecture from one side, and, from another side, trying to prototype some technology elements, figure out what library units should be developed and reused. Then, in your design and further work, they face with some problems. It's important to realize them well, not jumping to the solutions right away, try to get to the very nature, essence of the problem, avoiding ad-hoc resolution. In other words, make a pause for some thinking. It's important to understand that the development is iterative, so you can come to this phase more than once during the life cycle of development. And only in such a phase of development, when the problem is well realized, you can think: and what other people did in similar situations? And then you can refresh your memories on existing design patterns, or read about them, or scan a list of them, trying to think: "can one or another pattern help my work?" And only then some code samples could be helpful.

Also you need to understand that your project may or may not require some creative approach, creating of some specialized variants of known patterns or even new patterns. At the same time, many patterns can be used as is. It depends on many different factors. Many small patterns are already implemented in some framework.

Sorry, but that's all, because you did not share with us any detail.

—SA
 
Share this answer
 
v2
Comments
nischalinn 19-May-15 0:13am    
thanks Sergey Alexandrovich Kryukov for the reply. I've mentioned my language and platform. Language :: C#, desktop application, visual studio 2013
Sergey Alexandrovich Kryukov 19-May-15 0:32am    
All right, I edited the answer accordingly, thank you. But the idea is the same... :-)
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900