wayne wrote:
If you have been working with OOP for a while without the knowledge of DP then a book on design patterns will just teach you the names of the things that you have been doing before.
Well, I've been doing OOP for two years now and pretty much know how it works.
If you keep designing in the way of encapsulation, inheritance, polymorphism and data hiding, your code will become and remain flexible/dynamic/easy to maintain. But still, I often find myself blocking myself in my coding, by thinking to much about the design. My code really needs to be "outstanding". If not, I just stare at it, figuring out, how to do it better. About a year ago, I was doing this "staring-thing" to globals. I didn't like the way they were, so I started to ask people how they would solve it. As result I implented a sort of singleton. If I now think: "I need a global point of access", I immediatly go for this pattern: Perhaps you could say in this case, that I am thinking in a pattern. And I like this way of thinking, because you don't have to think (much). I also find it to boost up your thinking: when thinking about something I often use words. For example, if I am thinking about creating a composition, I could think about the word "composition" rather then think about eg "a class with elements where the structure contains data objects or other structures". Or even worse, thinking about the naming and types of these data objects. By thinking just composition, I already define a set of rules of how it should be implented. I hope some day I will have definition for all the problems I customer ask me
. Then when he is speaking, I would just write some "pattern names" and thereby shorten his 12 twelve page story to a small 1 or 2 pages. And yes... I do think DP's will allow me to at least define some set of rules
.