https://github.com/ngljcb/px-filesystem-design-patterns
Repository showcasing software design patterns, part of a university course on software development methodologies. Includes implementations of Factory, Adapter, Composite, Observer, and more, with comprehensive examples and tests.
https://github.com/ngljcb/px-filesystem-design-patterns
adapter composite design-patterns gof-patterns java observer software-design software-development strategy visitor
Last synced: about 1 year ago
JSON representation
Repository showcasing software design patterns, part of a university course on software development methodologies. Includes implementations of Factory, Adapter, Composite, Observer, and more, with comprehensive examples and tests.
- Host: GitHub
- URL: https://github.com/ngljcb/px-filesystem-design-patterns
- Owner: ngljcb
- Created: 2024-06-01T07:38:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-01T09:05:09.000Z (about 2 years ago)
- Last Synced: 2025-03-23T22:38:55.151Z (about 1 year ago)
- Topics: adapter, composite, design-patterns, gof-patterns, java, observer, software-design, software-development, strategy, visitor
- Language: Java
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Design Patterns Practical Example: Filesystem
## Overview
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.
## Table of Contents
- [Introduction](#introduction)
- [Design Patterns Covered](#design-patterns-covered)
- [Folder Structure](#folder-structure)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Testing](#testing)
## Introduction
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.
## Design Patterns Covered
This repository covers the following design patterns:
1. **Creational Patterns**
- Factory Method
2. **Structural Patterns**
- Adapter
- Composite
3. **Behavioral Patterns**
- Observer
- Strategy
- Visitor
## Folder Structure
```
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
```
## Getting Started
### Prerequisites
- Java Development Kit (JDK) 8 or higher
### Installation
1. Clone the repository:
```bash
git clone https://github.com/ngljcb/project_16251_dpfilesystem.git
cd project_16251_dpfilesystem
```
## Usage
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.
### Running an Example
1. Navigate to the directory of the design pattern you want to run.
2. Compile the Java files:
```bash
javac src/mp/exercise/filesystem/*.java
```
3. Run the main class:
```bash
java src/mp/exercise/filesystem/Main
```
## Testing
The project includes unit tests for the implemented design patterns.