I am wondering what should be the step by step analyzing approach to a well defined problem for figuring out the possible Design Patterns that can fit in the solution.
Any guidance you can recommend?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Any design pattern repository will give you hints such as “this is useful when…”, but usually there aren’t any indexes that would allow you too look up “credit card numbers” and return “flyweight object”. The nearest thing available is usually the loose grouping of patterns as behavioural, construction etc.
In my opinion there is no point in approaching a problem by wondering which design pattern you should apply. If you are sufficiently familiar with a pattern, you will notice straight away that it applies and how. If you don’t see a fit, then trying to press a pattern into service merely so you can say “I used pattern XX, so the design must be good!” is a dangerous mistake.
There are people who even say that design patterns are a kludge in the first place, an indication that your language is not expressive enough. (This is not as crazy as it sounds; consider that things such as WHILE loops or hash tables were once absent from programming languages, and master programmers of that era would have to reimplement them again and again; now they are part of the syntax, and no one would dream of calling them ‘patterns’.) Me, I’m not that extremist; I think a well-selected design pattern can be very useful indeed when you use it because you are convinced that it is a good solution, but that requires you to thoroughly understand it, and in my experience, this almost always requires having practiced it yourself. The value of patterns lies in giving a recognizable name to something that is often done, so you can remember it better and communicate about it with your peers.