Any list of Design Patterns possible sorted By "Frequency Of Usage?"
Is there any list of Design Patterns showing which are the most used ones; let's say sorted by frequency of t开发者_如何学运维heir usage.
I presume if there is such a list available, maybe it can be a kind of guide to know where to start to learn and practice design patterns.
Thanks.
There is a list @ http://dofactory.com/Patterns/Patterns.aspx. It's not sorted by frequency but rather type (Structural, Creational etc...). However, each pattern does have a frequency of use value ranging between 1 and 5 so you could sort the list yourself.
They're a pretty good resource with some concrete code examples and UML for the patterns. I suggest you give them a try.
HTH
Singleton has serious market share :P The amount of real world usage has little to do with the merit of a pattern (or how many times it messes stuff up).
I am also interested in this and the way I tackled it was by looking at the frequency of SO tags. For example I found that 'mediator' tag only had 8 questions whereas 'strategy' had 45 and 'singleton' 293. OK it's crude but it's probably unbiased!
Any such list would be deceiving you.
In a typical program you would use many different design patterns, even if you knew nothing about design patterns and had never learned how to use them. The fact is that design patterns describe common ways of working, common ways of structuring code. Because of this, you would have to spend many months analysing code, cataloguing the patterns, in order to create such a list.
I don't think anyone has done this yet.
The best thing to do is to just work your way through some design patterns tutorials.
If a design pattern seems useful, pay attention, if it doesn't then skim over it. Once you have some basic understanding, dive into a book like this one.
精彩评论