First, there was "new". But then some humans wanted to construct objects in many different ways, speak fluently to populate them and sometimes even to reuse a similar instance over and over again. In the meantime others offered to give us the objects we need, but then refused to tell us the exact nature of the object they gave us. The vast majority of people though humbly realized that a single instance was enough for them, and built cities and frameworks to help them manage large amounts of interconnected objects. Then frameworks turned to magic and proxies were given to citizens with the promise to simplify their lives by offering more lifecycles. Realizing they were pushed away from the path of "True OOP", some chose to step away, but then had to pay the toll to The System. This is the story of instantiation. 😊
In the text above, can you find the design patterns from the agenda below? Hint: we first talked about creational patterns used in tests, then in frameworks, and then in typical business-logic web apps/services. Analogies like that will spice up the explanations throughout the training, to make you remember these design patterns for good.
This training covers the best Design Patterns used today to instantiate objects. The content draws its roots the Creational Patterns in the classic GoF book, selects those patterns that are still in wide use today, and puts them in the context of modern frameworks, plus adds several new patterns that crystallized over the past 25+ years. The content was brainstormed with hundreds of developers in more than 30 companies, in languages like Java, PHP, and C#, so there will be references to other languages as often as possible. For the past 4 years, Victor has been lecturing a simplified version of these topics to 2nd year Computer Science students as part of the OOP course at Politehnica University.
This is the recording of a 3½ hours live webinar that took place in November 2020.
- Singleton Pattern, and other major lifecycles supported by Dependency Injection frameworks: prototype, request
- Factory Methods for Immutable Objects
- Static Factory Method Pattern - typical use-cases
- The "Factory" Pattern, and why it's (usually) a code smell
- Abstract Factory Pattern
- Fluent Builder idiom: 5 flavors, advanced tweaks and (better) alternatives
- Prototype and Object Mother Pattern for reusing test data
- Null Object Pattern and variants
What to expect?
During this trainings we solve a series of exercises together (80% of the time) in Java introducing each pattern smoothly, discussing the purpose, pros and cons of each in detail. For the singleton pattern we'll use the Spring framework as an example container (<20% total time), but all the ideas are directly applicable in any other Java framework: JavaEE, Quarkus and Micronaut.
After following this workshop, you'll take away at least a dozen of key practical techniques that you can immediately apply to your day-to-day work. Expect an intense experience, as usual!
But perhaps the best part of all is that you can ask any question you want to a Java Champion and former Lead Architect at IBM. There will be no unanswered questions™️😀
Any developer with some prior experience in an OOP language (Java, PHP, C#). The content covers design techniques for business-logic-intensive apps as well as for framework development.
To be able to run the code locally, your machine should have a Java 8+ SDK installed, a decent IDE, and access to GitHub and Maven Central.
After purchase, besides video recording and slides, you will be able to download the final code zipped together with the git history, allowing you to browse through the commits at your own pace.
If you want to get the best value out of this workshop, you could (re)read in advance about the patterns we will cover: Singleton, Static Factory Method, Abstract Factory, Fluent Builder, Null Object. In case it's your first contact with these patterns, I strongly recommend you the "Head First - Design Patterns" book.
Looking forward working with you!
P.S.: The content is distilled from my 2-days (16-hours) Design Patterns training. If you are interested in a private dedicated session for your company, please find here my entire curricula and contact details.