# Java-DesignParttern **Repository Path**: dgatiger/Java-DesignParttern ## Basic Information - **Project Name**: Java-DesignParttern - **Description**: 整理的JAVA实现的23种设计模式,含PlantUML画的UML图。 JAVA代码来自:http://c.biancheng.net/design_pattern/,略有调整。 PlantUML图脚本来自:https://blog.csdn.net/u010144805/article/details/82415385 PlantUML官网:https://plantuml.com/zh/sequence-diagram - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-03-21 - **Last Updated**: 2025-05-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Java Design Patterns This project demonstrates various design patterns in Java, including creational, structural, and behavioral patterns. ## Project Structure ``` src/ ├── main/ │ └── java/ │ ├── creatingPattern/ # Creational patterns │ └── structuralPattern/ # Structural patterns uml/ # UML diagrams └── README.md ``` ## UML Diagrams The project includes PlantUML diagrams for each design pattern. These diagrams are stored in the `uml/` directory and can be viewed using various methods: 1. Using PlantUML Online Server 2. Using VS Code Extension 3. Using PlantUML CLI 4. Using Maven Plugin For detailed instructions on how to view and generate the diagrams, please refer to [uml/README.md](uml/README.md). ## Design Patterns ### Creational Patterns - Singleton Pattern - Factory Method Pattern - Abstract Factory Pattern - Builder Pattern - Prototype Pattern ### Structural Patterns - Adapter Pattern - Class Adapter - Object Adapter - Two-way Adapter ## Getting Started ### Prerequisites - JDK 17 or higher - Maven 3.6 or higher - PlantUML (optional, for viewing UML diagrams) ### Building the Project ```bash mvn clean install ``` ### Running Examples ```bash mvn exec:java -Dexec.mainClass="creatingPattern.singleton.HungrySingleton" ``` ## Documentation Each design pattern implementation includes: - Detailed code comments - UML diagrams - Example usage - Design intent and usage scenarios ## Contributing 1. Fork the repository 2. Create your feature branch 3. Commit your changes 4. Push to the branch 5. Create a new Pull Request