Development Design Patterns in Magento 2
At Magento Live UK 2016 conference I've presented technical topic "Key Insights into Development Design Patterns in Magento 2". It contains various Design Patterns used across Magento 2 framework and modules. There are a lot of functionality which require complex logic and Design Patterns help to achieve and implement functionality in a quite straight forward way.
What is Design Pattern? Design Pattern describes a problem which occurs over and over again, and then describes the core of the solution to that problem, without ever doing it the same way twice. Christopher Alexandr and his students defined Design Pattern back in 1977.
Aspect Oriented Programming
Aspect Oriented Programming is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. The goal is to achieve loose coupling.
There are various cross-cutting concerns in Magento 2 which have to go through all modules. Few examples of cross-cutting concerns are: security, monitoring and logging.
In the "Key Insights into Development Design Patterns in Magento 2" presentation the following Design Patterns covered:
- Composite Pattern
- Strategy Pattern
- Factory Method Pattern
- Observer Pattern
- Object Manager (which consist of 11+ Design Patterns)
- Decorator Pattern
- Proxy Pattern
Almost all examples are based on Payment module implementation and its usage. Remaining Design Patterns examples are based on Magento 2 Framework.