For the first time in the history of the Webfrontend FG, a blog series is taking place. Yes, you heard right, a blog series. In the next 8 posts, we want to introduce you to some common design patterns from the GoF (Gang of Four) pool and show you their significance. You can look forward to very exciting JavaScript patterns from various authors.
What are patterns?
By a design pattern, a software developer typically refers to a specific code module that has proven to be a tried and tested solution/approach to a common, recurring problem. Every programming language has its own design patterns. This includes JavaScript, which has two types of object orientation: prototypical or ES6 class syntax. Over the next few weeks, however, we do not want to work through all the variants of object orientation for each pattern, but rather make the whole thing a little more varied. It is therefore up to each author to decide which approach he or she chooses.
Why Patterns?
Design patterns should not be used for the sake of the design pattern. If this principle is observed, the following advantages will also result from its use. Faster and more efficient work on complex problems comes to mind without giving it much thought. Positive effects on teamwork are also conceivable. The whole thing is flanked by easy expandability, maintainability and flexibility. I won't go into the other advantages in detail, as that would go beyond the scope of the opening post.
Which patterns do we present to you?
Creational Design Patterns
- Factory Method - Creates objects in a central location
- Builder - Simplifies complex processes when creating objects
Structural Design Patterns
- Adapter - Adapts the interface of a class to another interface
- Facade - Provides a uniform interface for a set of interfaces of a subsystem
Behavioral Design Patterns
- Mediator (in form Publish Subscribe) - Coordinates the interaction of several objects
- Memento - Saves the state of an object so that the object can be restored to this state at a later date
- Observer - Enables objects to be notified when the status of other objects changes
- State - Allows the behavior of an object to be adjusted depending on the state of the object
The Webfrontend FG wishes you lots of fun & a wonderful weekend!



