Design patterns in software development

Design patterns are necessary to quickly solve standard programming tasks. In the process of development, the same problems are constantly found, and the programmer does not need to invent the optimal solution every time he can use the finished template (pattern).

However, the issue of choosing a typical approach remains with the developer himself. In our article we will tell you what design patterns are, how they differ from similar tools and how to choose the one that is necessary.

What is the design pattern

The term “Design Patterns” can be translated from English as patterns/templates/design samples. They are used in the process of creating information systems and are formalized descriptions of regular design problems, effective solutions to such problems and recommendations for using the solutions in certain situations.

It should be understood that all design patterns have generally accepted names. After an effective solution to the problem has been found, it is used again, if necessary.

It is worth noting that adequate modeling of the subject area under consideration acts as the most important initial stage in the process of working with patterns. This stage is needed not only for the correct (competently formalized) setting of the task, but also to determine suitable patterns.

An example of a scientific research, which describes the key points of building a model of analysis and design model, is the work of Craig Larman – “The use of UML and design patterns”.

Correctly using design patterns, the developer receives a lot of advantages. For example, the model built using patterns will be less complex and more visual in studying, regarding ordinary models. In addition, it will be a structured selection of important elements to solve the problem. At the same time, the resulting model will allow you to work out the architecture of the created system using a special language at the deepest level.

The use of design patterns makes the system more resistant to change of requirements. At the same time, further refinement of the system becomes much easier. The use of patterns is also very useful in the integration of the organization’s information systems.

The complex of design patterns can be safely called the developer dictionary. This is a universal tool that allows you to establish communication in the process of work.

The difference between patterns of design from similar tools

There are three main varieties of patterns:

architectural patterns;

design patterns;

idioms.

The first category includes patterns, which are top -level templates. They describe the structural diagram of the software system as a whole. In this scheme, separate functional components of the systems (subsystems) are located and the relations between them are determined.

As an example of the architectural pattern, you can take the popular software paradigm “Model-Controller” (Model-View-Controller-MVC). At the same time, subsystems contain architectural units of a lower level.

The difference between patterns of design from similar tools

The difference between patterns of design from similar tools

The second category is design patterns. They describe the details of the details of software subsystems and their relations among themselves. Such patterns do not affect the structure of the software system as a whole and do not depend on the use of the programming language.

A striking example is GOF patterns. Patterns of designing object-oriented systems are a description of the interaction of objects and classes that are adapted to solve the main design problem in a certain context.

Idioms are low -level patterns. Their subject area is the implementation of a particular problem taking into account the specifics of the corresponding programming language. The type of idiom can be different depending on which language it is applied to. In some cases, the idiom will not make any sense at all.

Say, in C ++, intellectual pointers can be used to combat probable memory leaks. Each such pointer notes a section of dynamically selected memory, which will be automatically released in the automatic mode when leaving the visibility zone. Within the framework of Java, this problem is not at all. The fact is that this language uses automatic garbage assembly.

As a rule, in order to use idioms, it is necessary to understand the nuances of the selected language very well. It is worth mentioning that in the field of programming there are several more varieties of patterns that are in no way related to design. For example, analysis, testing, documentation templates, etc.

Of course, the principles of OOP function, however, fragile theory is based on them. As a result, implementations with a large number of patches and holes appear, the causes of which are not intuitively understood.

Polymorphism is good because it allows you to create new classes that are logically very similar to the basic. This provides the possibility of expansion and modification. At the beginning of the article, we gave a simple example that demonstrated how greatly facilitates the development of the use of abstractions. That is, you can work with news as well as with ads or articles.

It is interesting that there is no need to find out which object the work is underway with. And if we consider not a simple given example, but the real work of more complex applications, the benefits of polymorphism become even more understandable.

Leave a Reply

Your email address will not be published. Required fields are marked *