What is a Design Pattern

The design pattern is a proven and ready-to-use solution. This is not a class or a library that can be connected to the project, it is something more - it does not depend on the programming language, it is not a complete sample that can be directly converted into code and can be implemented in different ways in different programming languages.

Pros of using templates:

  • reducing the complexity of development due to ready-made abstractions for solving a whole class of problems.
  • facilitating communication between developers by allowing reference to known patterns.
  • unification of solution details: modules and project elements.
  • the opportunity to find a good solution, use it again and again.
  • assistance in choosing the most suitable design option.

Minuses:

  • blindly following some chosen pattern can complicate the program.
  • a desire to try a certain pattern in action without any particular reason.

What are the main characteristics of templates

  • Name - all templates have a unique name that serves to identify them;
  • Purpose - the purpose of this template;
  • Task - a task that the template allows to solve;
  • Solution method - the method proposed in the template for solving the problem in the context where this template was found;
  • Participants - entities taking part in solving the problem;
  • Consequences - the consequences of using a template as a result of actions performed in the template;
  • Implementation is a possible implementation of the pattern.

Read also:


Comments

Popular posts from this blog

Methods for reading XML in Java

XML, well-formed XML and valid XML

ArrayList and LinkedList in Java, memory usage and speed