[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppDesignPattern

(C++) Design pattern

A common used way of structuring a class. Reference 1 is the book to start. These patterns e.g. achieve that a class can only have one instance (Singleton).

Some design patterns (from [1]):
  • Abstract Factory
  • Adapter
  • Bridge
  • Builder
  • Chain of Responsibility
  • Command
  • Composite
  • Decorator
  • Facade
  • Factory Method
  • Flyweight
  • Interpreter
  • Iterator
  • Mediator
  • Memento
  • Observer
  • Prototype
  • Proxy
  • Singleton
  • State
  • Strategy
  • Template Method
  • Visitor

Comparing design patterns to simpler solutions

In a study by Prechelt et al. [2], the use of a desgin pattern to solve a problem was compared with using a simpler solution. Many of a pattern's flexibily is unused, due to the simplicity of the problems. Nevertheless, using a pattern decreases maintenance time and flexibily was added quicker. The conclusion drawn was that 'unless there is a clear reason to prefer the simpler solution, it is probably wiser to choose the flexibilty of the design pattern, because unexpected new requirements often appear'.

Program documentation when using design patterns

In a study by Prechelt et al. [3], some tasks were assigned to perform on two versions of a highly documented (using comment lines in the code) program. The only difference was that in one version, the design pattern is explicitly mentioned. It was found that this increased the speed of maintenance and fewer errors were made.

References

  • 1) Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. Design Patterns. Publisher: Addison-Wesley Professional; 1st edition (January 15, 1995). ISBN: 0201633612
  • 2) Prechelt L, Unger B, Tichy WF, Broessler P, Votta LG. 2001. A controlled experiment in maintenance comparing design patterns to simpler solutions. IEEE Transactions on Software Engineering 27-12:1134-1144.
  • 3) Prechelt L, Unger B, Philippsen M, Tichy W. 2002. Two controlled experiments assessing the usefulness of design pattern documentation in program maintenance'. IEEE Transactions on Software Engineering 28-6:595-606.


last edited (November 11, 2006) by bilderbikkel, Number of views: 1424, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.