Simple design patterns demos implementations in java. Covering the basic Creational, Behavioral and Structural design patterns. As a bonus I have created a DAO design pattern implementation as well as a local database and a logger. Many of these are a compiled version of running examples from the internet.
Contents: Behavioral Patterns(Chain of Responsibility Pattern, Dependency Injection Pattern) , Creational Patterns (Abstract Factory Patterns, Object Pool Pattern, Prototype Pattern, Singleton Pattern), Structural Patterns (Adapter Pattern, Composite Pattern) and misc(DAO Pattern)
I have tried to make these examples in a simple way. Notes:
-
In order to run the Singleton with Postgres like I have configured, make sure you include the driver jar in the classpath!
-
Most of these examples are meant to recreate small solutions to problems I created. These solutions could error-prone.
-
In every package there is a Demo java file which you can run.
credits: https://www.journaldev.com/java/design-patterns, https://www.javatpoint.com/design-patterns-in-java for some ideas around some of these implementations.