Do learning Object-Oriented Design Patterns is really beneficial?

Imaji Pietersz
4 min readJun 1, 2021

Hy todos! Let me ask you a simple but critical question. Do you really think that we should spend weeks and weeks studying Object-Oriented Design Patterns in our universities and colleges, while some manage to work successfully as a programmer for many years without knowing about a single pattern? If you have the same question, this blog is specially dedicated to you.

Program to an interface, not an implementation — Gang of Four 1995

In simple terms, Object-Oriented Design Patterns are common solutions to common problems. If not “reusable solutions to commonly occurring problems”.Software development design patterns began as best practices that were applied to similar problems in various contexts over and over again.· However, reusing design patterns does not necessarily result in a direct reuse of algorithms, detailed designs, interfaces, or implementations.

Let’s jump straight to the benefits of learning oo patterns and see why our lecture expected us to learn most of the design patterns at least half of our semester.

Design patterns can save development time by using existing solutions rather than recreating the wheel, resulting in faster delivery.

Each pattern explains an issue that arises frequently in our environment, followed by the core of the solution to that problem, in such a way that you can use it a million times without doing it the same way twice.

They make it easier to reuse successful designs and avoid alternatives that diminish reusability.

When building applications in a certain environment, design patterns capture the static and dynamic structures of solutions that recur frequently. Because patterns address a fundamental difficulty in large-scale software development, systematically adding design patterns into the software development process helps enhance software quality. Patterns can also be utilized in software architecture, and when utilized correctly, they can boost the underlying system’s flexibility and reusability. Each pattern allows for the alteration of one part of the system structure without affecting the others.

Improved IT process and communication

A common vocabulary helps design patterns to organize the entire process and community. They help to improve software communication quality by addressing a key issue in large-scale software development: the sharing of architectural knowledge among engineers.

Put simply, design patterns help a designer get a design “right” faster. Patterns improve the documentation and maintenance of existing systems by furnishing an explicit specification of class and object interactions and their underlying intent.

These are only a few reasons to use oo design patterns.

sounds great right? But as every coin has two sides, using oo design patterns also consists of merits and demerits both.

Here are why you shouldn't consume time on oo design patterns.

It is still an art that can only be mastered after many years of practice.

Developers can still make the error of using a design pattern when it isn’t required, such as when a subsystem isn’t required for the use of a proxy pattern. It is based on the developers’ prior expertise with the product. So as it seems like till you become a pro at design patterns you can’t guarantee the actual benefits we mentioned above.

Over-engineering and under-engineering

Over-engineering occurs when a design or piece of code is more flexible or sophisticated than it needs to be, usually in anticipation of future extensions that may or may not occur. Under-engineering is far more common than over-engineering because programmers are frequently under time and expense constraints, and hence are unable to devote the time necessary to carefully consider and craft their improvements. Both can occur by using design patterns. So most probably you are just wasting time or maybe even worst.

The use of design patterns does not necessarily improve quality

According to several studies, using design patterns does not always result in “goo” designs. A convoluted implementation of patterns, for example, has a negative influence on the quality that these patterns claim to improve. Patterns also tend to make future enhancements easier at the sacrifice of simplicity. As a result, evidence of quality improvements resulting from the application of design patterns is mostly comprised of intuitive statements and examples. When it comes to design patterns, there is little empirical data to back up promises of increased reusability, expandability, and understandability. Furthermore, the influence of design patterns on other quality criteria is unknown.

Design patterns may increase the complexity

Flexibility in design patterns frequently comes at a cost of complexity, as dynamic, highly parameterized software is more difficult to comprehend and document. According to the findings, individual software developers’ poor judgments typically add complexity without benefit, resulting in designs that are difficult to change or remove.

Here are the main disadvantages that tend to happen by using oo design patterns. This shows that as beneficial as they are, they also have a number of drawbacks if they are not used correctly.

By the way, by going through this information I still agree that we should learn design patterns as it is very beneficial but It's not necessary to implement all of the design patterns in your software development, though you can leverage the appropriate design patterns to your problems in software development.

Now it is your time to critically analyze is it really effective to learn and use design patterns for you. Hope this article helps you to understand the importance of design patterns and eliminate the risk of using design patterns inappropriately.

Happy Learning!!

--

--