▲ | RossBencina 4 days ago | ||||||||||||||||
> Design patterns suffer because in most explanations the context is completely missing. "most explanations"? Most crappy explanations on the web and in introductory courses perhaps. The original GoF Design Patterns book and all of the Pattern Languages of Program Design books that followed it define and adhere to a pattern (form, template) for how to document design patterns. The main elements of this form are (GoF, p.3): 1. The *pattern name* ... 2. The *problem* describes when to apply the pattern. It explains the problem and its context [emphasis mine]. ... 3. The *solution* ... 4. The *consequences* are the results and trade-offs of applying the pattern. ... I am guessing this form comes from Christopher Alexander, but I don't have a copy of A Timeless Way of Building at hand. | |||||||||||||||||
▲ | galaxyLogic 4 days ago | parent [-] | ||||||||||||||||
Don't overlook the "Forces". While "Problem" explains WHY you might need the specific pattern in question, the "forces" explain why some trivial solutions are not very good solutions, because you have to take into account the constraints, the assumptions about the context, why the problem is actually a problem. MVC is a great, even proverbial pattern, but I don't recall having seen it presentewd in the "Patterns Format" anywhere. Such a presentation would make it easier to understand no doubt. | |||||||||||||||||
|