This project demonstrates the implementation of various software design patterns. It is part of a university course on software development methodologies, aiming to provide practical, clear examples to help understand and apply design patterns.
Design patterns are typical solutions to common problems in software design. This project includes several well-known design patterns, each illustrated with example code and detailed explanations.
This repository covers the following design patterns:
-
Creational Patterns
- Factory Method
-
Structural Patterns
- Adapter
- Composite
-
Behavioral Patterns
- Observer
- Strategy
- Visitor
project_16251_designpattern01/
├── src/
│ └── mp/
│ └── exercise/
│ └── filesystem/
│ ├── FileSystemDirectory.java
│ ├── FileSystemDirectoryResourceEvent.java
│ ├── FileSystemFile.java
│ ├── FileSystemResource.java
│ ├── FileSystemResourceAddedEvent.java
│ ├── FileSystemResourceEvent.java
│ ├── FileSystemResourceEventVisitor.java
│ ├── FileSystemResourceObserver.java
│ ├── FileSystemResourceRemovedEvent.java
│ ├── FileSystemResourceRenameEvent.java
│ ├── FileSystemVisitor.java
│ ├── FileSystemVisitorAdapter.java
│ └── utils/
│ ├── DirectoryFilesCollectionSupplier.java
│ ├── DirectoryFilesCollectorObserver.java
│ ├── DirectoryLoggerObserver.java
│ ├── FileSystemLsVisitor.java
│ ├── FileSystemNonRecursiveLsVisitor.java
│ ├── FileSystemPrinter.java
│ ├── FileSystemUtils.java
│ ├── ResourceLs.java
│ ├── ResourceLsDecorator.java
│ ├── ResourceLsName.java
│ ├── ResourceLsSize.java
│ └── ResourceLsType.java
└── tests/
└── mp/
└── exercise/
└── filesystem/
├── FileSystemDirectoryTest.java
├── FileSystemFileTest.java
├── MockFileSystemResourceObserver.java
└── utils/
├── DirectoryFilesCollectorObserverTest.java
├── DirectoryLoggerObserverTest.java
└── FileSystemPrinterTest.java
- Java Development Kit (JDK) 8 or higher
- Clone the repository:
git clone https://github.com/ngljcb/project_16251_dpfilesystem.git cd project_16251_dpfilesystem
Each design pattern is implemented in a self-contained module. You can run the examples using your preferred Java IDE or through the command line.
- Navigate to the directory of the design pattern you want to run.
- Compile the Java files:
javac src/mp/exercise/filesystem/*.java
- Run the main class:
java src/mp/exercise/filesystem/Main
The project includes unit tests for the implemented design patterns.