I want to know the differe开发者_运维问答nce between design pattern and enterprise design pattern e.g. some books call ActiveRecord an enterprise design pattern, while singleton is a design pattern.
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.
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!
Something that the consultants will charge an extra $80-$200/hr for.
精彩评论