22. December 2022 Design Pattern
Design patterns are one of the most important things in programming. At a certain point in your own programming career you will have to deal with design patterns. And still some programmers have no idea, what design patterns are and what they are for. If you are a programmer and you don’t know anything about design patterns, then it’s time to learn.
If you want to know, what Design Patterns are, I recommend to read the following article by Refactoring Guru. Refactoring Guru provides a very good overview on the history, classification and examples of design patterns.
There is also a free online book about Design Patterns on Sourcemaking.com.
Design Patterns and ABAP
When searching for design patterns and ABAP, you will find the following sites:
- ABAP TUTORIAL
Naimesh Patel published some ABAP examples for a lot of design patterns years ago and they are still valid and helpful.
Of course there are then and now articles about design patterns. Here are some:
- Design Patterns in ABAP: Factory and singleton (and the wonderous world of OO-Abap) by Jan-Willem Kaagman
- Factory-Pattern in ABAP OO by Hendrik Brandes
- Possibly the most important design pattern of them all (MVC) by Katan Patel
- A General Purpose ABAP Multiton Class by Kerem Koseoglu
And some articles by by Jerry Wang
- Visitor pattern used in CDS View Test double framework
- Some refacting examples with the help of Function.prototype
And of course Paul Hardy has published some posts about Design Patterns:
- OO Design Patterns – Decorator – in ABAP
- Design Patterns in ABAP – Visitor
- Charlie and the Chocolate Factory Pattern
- Articles by ABAP TUTORIAL
- Here is an interesting article in german about the Singleton Design pattern.
- Iterator [Design Pattern] by Tricktresor
- ABAP Freak Show – Constructor vs Factory Method by Thomas Jung and Rich Heilman
- Example ABAP OO Patterns on github by SchwarzIT
- German Webinar Entwurfsmuster in ABAP by Cadaxo (Föß and Domi)
Design Patterns in ABAP Objects
Read this book about Desing Patterns by Kerem Koseoglu:
The extract is about the MVC Design Pattern.
Head First Design Patterns
A book that helped me understanding Design Patterns is Head First Design Patterns by O’Reilly.
The Design Patterns are valuable techniques with their pros and cons. You will have to check what patterns suit best. But there are patterns that are always bad: The Anti Patterns. Again Paul Hardy had something to say about it: Anti Patterns and Anti Patterns two. Also read the article Anti Patterns in ABAP Development Projects by SAP-Mentor Tobias Trapp.