Learning/Implementing Design Patterns (For Newbies)

I'm a confused newbie and hobbyist programmer trying to get a grip on this, so forgive me if my question is a little off or doesn't make much sense.

I see a lot of questions on SO revolving around the use of design patterns, and I'm wondering if anyone has a good resources for learning about, and implementing design patterns? I understand the general idea, and know how/when to use a couple of them(Singletons, Factory methods) but I know I'm missing out.

(Just in case it matters, my language of preference is C# but I could learn from examples in other languages)


Head First Design Patterns

替代文字

and the Design Pattern Wikipedia page are the best resources for beginners. FluffyCat is another good, free online resource for design patterns in both Java and PHP.

The Gang of Four book is where to go afterward, but it's fairly advanced, so I'd wait until you have a pretty firm grasp from the other resources.


Design patterns are great for various reasons:

  • gives you a starting for solving common problems.
  • gives developers a vocabulary to talk about certain ways of solving problems in a very compact manner.
  • when working with developers who know design patterns and you use design patterns in your solutions they will understand the solutions a lot faster.
  • But when your goal is just to learn design patterns I think you are missing the fundamentals. All design patterns are based on more common principles. High Cohesion, Low Coupling Open Closed Principle, DRY, Liskov Substitution Principle etc. For these fundamentals I would read the following books in this order:

  • Head First Object-Oriented Analysis and Design (Head First) [ILLUSTRATED] (Paperback)
  • Applying UML and Patterns (Hardcover)
  • Agile Principles, Patterns, and Practices in C# (Robert C. Martin Series) (Hardcover)
  • After that you are ready for the basic gang of four design patterns

  • Head First Design Patterns (Head First) [ILLUSTRATED] (Paperback)
  • The BIBLE
  • A nice website (don't buy anything, it is not worth it) http://dofactory.com/Patterns/Patterns.aspx (some implementations of this site are worth a discussion
  • The next step:

  • Patterns of Enterprise Application Architecture (Addison-Wesley Signature Series) (Hardcover)
  • The POSA books
  • And always remember : the pattern is not the goal !


    我想补充一下,“四人帮”中的设计模式书对于那些对设计模式非常感兴趣的人来说是一本圣经。

    链接地址: http://www.djcxy.com/p/50224.html

    上一篇: Java断言关键字的作用是什么,以及何时应该使用它?

    下一篇: 学习/实现设计模式(适用于新手)