问题描述
我是一个困惑的新手和业余爱好者程序员,试图掌握这一点,所以如果我的问题有些不对劲或没有太多意义,请原谅我.
我看到了很多关于设计模式使用的问题,我想知道是否有人有良好的资源来学习和实施设计模式?我了解一个总体想法,并且知道如何/何时使用其中的几个(单例,工厂方法),但我知道我错过了.
(以防万一重要,我的偏爱语言是C#,但我可以从其他语言中学习)
推荐答案
设计模式Wikipedia页面是初学者的最佳资源. fluffycat 是 java 和 php .
四本书的帮派是四本书之后,但这是相当先进的,所以我要等到您从其他资源中掌握了一个非常牢固的掌握.
其他推荐答案
设计模式非常好,其原因是:
- 让您开始解决常见问题.
- 给开发人员一个词汇量,以非常紧凑的方式谈论某些解决问题的方法.
- 与了解设计模式的开发人员合作并在解决方案中使用设计模式时,他们将更快地了解解决方案.
但是,当您的目标只是学习设计模式时,我认为您缺少基本面.所有设计模式均基于更常见的原理.高凝聚力,低耦合开放式封闭原理,干燥,liskov替代原理等.对于这些基本原理,我将按照以下书籍阅读以下书籍:
- head首个面向对象的分析和设计(首先) [插图](平装)
- 应用UML和模式(硬cover) /li>
- 敏捷的原理,模式和实践.马丁系列)(精装)
之后,您已经准备好四个设计模式的基本帮派
- head First First Design Design模式(首先)平装本)
- 圣经
- 一个不错的网站(不要买任何东西,不值得) http://dofactory. com/patterns/patterns.aspx (本网站的某些实现值得讨论
下一步:
始终记住:模式不是目标!
其他推荐答案
问题描述
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)
推荐答案
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 !
其他推荐答案
I'd add that Design Patterns book from the "Gang of four" is a bible for anyone who is seriously interested in design patterns.