Free Ebook cover Basic to Advanced Logic Programming Course

Basic to Advanced Logic Programming Course

New course

50 pages

Design patterns

Capítulo 29

Estimated reading time: 3 minutes

+ Exercise
Audio Icon

Listen in audio

0:00 / 0:00

29. Design Patterns

Design patterns, also known as Design Patterns, are generalized solutions to common problems in software design and provide a framework for reusable solutions in the context of specific problems. In other words, they are templates that can be used in many different situations.

Origin of Design Patterns

Design patterns were popularized by a group of four authors known as the Gang of Four (GoF). They wrote a book entitled "Design Patterns: Elements of Reusable Object-Oriented Software", which is considered the bible of design patterns. In the book, they introduced 23 design patterns that have become widely accepted and used in the software development community.

Why Use Design Patterns?

Design patterns provide tried-and-true solutions to common problems in software design. They improve developer efficiency by reducing the amount of issues that need to be resolved from scratch. In addition, design patterns promote code reuse and can speed up the development process, improving software quality.

Types of Design Patterns

Design patterns can be categorized into three main types: Creational, Structural, and Behavioral.

Creational Patterns

Creational design patterns deal with object creation mechanisms, trying to design objects appropriately for the situation. The basic creational patterns are: Singleton, Factory, Abstract Factory, Builder, Prototype.

Continue in our app.

You can listen to the audiobook with the screen off, receive a free certificate for this course, and also have access to 5,000 other free online courses.

Or continue reading below...
Download App

Download the app

Structural Patterns

Structural design patterns are concerned with the composition of classes or objects. They help ensure that when one part of the system changes, the entire system doesn't have to change with it. The basic structural patterns are: Adapter, Bridge, Composite, Decorator, Facade, Flyweight and Proxy.

Behavioral Patterns

Behavioral design patterns are concerned with communication between objects, how they interact, and allocating responsibilities. They can help increase flexibility in carrying out this communication. The basic behavioral patterns are: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method and Visitor.

Conclusion

Design patterns are an essential part of object-oriented programming. They provide ready-made solutions that can be adapted to real-world coding problems. Learning these patterns and knowing when and where to apply them can help speed up the development process, improve code quality, and make code easier to understand and maintain.

In our programming logic course, we will explore each of these patterns in detail, showing practical examples of how they can be used in real situations. We'll discuss the advantages and disadvantages of each pattern and provide tips on when it's appropriate to use each one. With a solid understanding of design patterns, you'll be well equipped to tackle any programming challenge you encounter.

Now answer the exercise about the content:

Who popularized design patterns and what book did they write?

You are right! Congratulations, now go to the next page

You missed! Try again.

The Gang of Four (GoF) popularized design patterns with their book Design Patterns: Elements of Reusable Object-Oriented Software. This work introduced widely accepted design patterns essential for software development.

Next chapter

Code refactoring

Arrow Right Icon
Download the app to earn free Certification and listen to the courses in the background, even with the screen off.