This repository contains the implementation of various design patterns using Spring Boot 3 for the topic of "Learn Code for Design Patterns".
Design patterns are divided into three categories:
-
Creational Patterns (creational design patterns): These patterns provide a way to create objects in a manner suitable to the situation. The goal is to create objects in a way that is appropriate to the context. Examples of creational patterns include Singleton, Factory, Abstract Factory, Builder, Prototype, and Composite.
-
Structural Patterns (structural design patterns): These patterns deal with object composition, that is, how different objects are combined to form larger objects. They provide a way to make the design flexible and modular by identifying simple yet effective ways to compose objects. Examples of structural patterns include Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy.
-
Behavioral Patterns (behavioral design patterns): These patterns define the interactions between objects. They identify common communication patterns between objects and realize these patterns. Examples of behavioral patterns include Observer, State, Strategy, Template Method, Command, Iterator, and Mediator.
Each pattern has its own directory with a detailed implementation and readme file.
To run this application using Docker, you can follow these steps:
-
Make sure you have Docker installed on your machine.
-
Clone this repository to your local machine:
git clone [email protected]:inghumberto/DesignPatterns.git
-
Navigate to the project directory:
cd DesignPatterns -
Build the Docker image using the provided Dockerfile:
docker build -t design-patterns . docker run -p 8080:8080 design-patterns
This command will start the application inside a Docker container and map port 8080 of the container to port 8080 of your local machine. You can access the application by navigating to http://localhost:8080 in your web browser.
To run this application using Docker, you can follow these steps:
-
Make sure you have Docker installed on your machine.
-
Clone this repository to your local machine:
git clone [email protected]:inghumberto/DesignPatterns.git
-
Build the Docker image by running
docker-compose buildin the terminal. -
Start the application by running
docker-compose upin the terminal.
The application will be accessible at http://localhost:9090/design-patterns.
Please note that Spring Boot 3 is not released yet, so the actual implementation may vary based on the final release.