What's the difference between design pattern and enterprise design pattern?

亡梦爱人 提交于 2019-12-10 17:47:31

问题


I want to know the difference between design pattern and enterprise design pattern e.g. some books call ActiveRecord an enterprise design pattern, while singleton is a design pattern.


回答1:


It probably has the most to do with what book it came from. Singleton was first popularized in "Design Patterns" by the Gang of Four. ActiveRecord was in "Patterns of Enterprise Application Architecture", by Martin Fowler.

The Gang of Four described Design Patterns as generally useful object-oriented class structures.

Fowler's book is about how to access enterprise pieces (databases, messaging backbones, etc) in object-oriented code.




回答2:


They both refer to design patterns, but at different levels of granularity.

As you have stated it, one could simply think of an enterprise design pattern as the design of the high level system components and how they work together across a distributed system for example, and a design pattern such as singleton to be at a code level of a particular component within the overall system.

But it may be more important to understand that a design pattern in a generic context, as Wikipedia does a good job of stating, "is a general reusable solution to a commonly occurring problem".

Enjoy!




回答3:


Something that the consultants will charge an extra $80-$200/hr for.



来源:https://stackoverflow.com/questions/3703994/whats-the-difference-between-design-pattern-and-enterprise-design-pattern

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!