Skip to content

Commit f8e0468

Browse files
Initial commit: Complete design patterns implementation with documentation and CI/CD
0 parents  commit f8e0468

File tree

104 files changed

+39963
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+39963
-0
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/topics

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
design-patterns
2+
java
3+
software-architecture
4+
gang-of-four
5+
creational-patterns
6+
structural-patterns
7+
behavioral-patterns
8+
educational
9+
maven
10+
junit
11+
performance-testing
12+
thread-safety
13+
best-practices
14+
software-engineering
15+
object-oriented-programming
16+
design-principles
17+
solid-principles
18+
refactoring
19+
code-quality
20+
documentation

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
java-version: [8, 11, 17]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up JDK ${{ matrix.java-version }}
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: ${{ matrix.java-version }}
25+
distribution: 'temurin'
26+
cache: maven
27+
28+
- name: Compile project
29+
run: mvn clean compile -q
30+
31+
- name: Run tests
32+
run: mvn test -q
33+
34+
- name: Package project
35+
run: mvn package -q -DskipTests
36+
37+
- name: Verify main class execution
38+
run: java -cp target/classes ch.hearc.patterns.Main demo
39+
40+
documentation-check:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Check documentation files
48+
run: |
49+
find docs/ -name "*.md" -exec echo "Checking {}" \; -exec head -1 {} \;
50+
51+
- name: Validate README links
52+
run: |
53+
if command -v markdown-link-check &> /dev/null; then
54+
markdown-link-check README.md --quiet
55+
else
56+
echo "markdown-link-check not available, skipping link validation"
57+
fi

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Compiled class files
2+
*.class
3+
4+
# Maven target directory
5+
target/
6+
7+
# IntelliJ IDEA
8+
.idea/
9+
*.iml
10+
*.iws
11+
12+
# Eclipse
13+
.classpath
14+
.project
15+
.settings/
16+
17+
# VS Code
18+
.vscode/
19+
20+
# NetBeans
21+
nbproject/
22+
23+
# OS generated files
24+
.DS_Store
25+
.DS_Store?
26+
._*
27+
.Spotlight-V100
28+
.Trashes
29+
ehthumbs.db
30+
Thumbs.db
31+
32+
# Logs
33+
*.log
34+
logs/
35+
36+
# Temporary files
37+
*.tmp
38+
*.temp
39+
40+
# Python cache (if any)
41+
__pycache__/
42+
*.pyc
43+
*.pyo
44+
45+
# Batch files output (if any)
46+
*.bat.out
47+
48+
# Test output
49+
test-output/
50+
51+
# Maven wrapper
52+
.mvn/
53+
mvnw
54+
mvnw.cmd

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Complete implementation of 23 design patterns (GoF collection + advanced patterns)
12+
- Comprehensive documentation for each pattern
13+
- Performance benchmarking system
14+
- Advanced testing suite with property-based testing
15+
- Pattern combination demonstrations
16+
- Performance monitoring capabilities
17+
- Thread-safe implementations
18+
- Professional code quality with validation and error handling
19+
20+
### Documentation
21+
- Detailed pattern explanations with UML diagrams
22+
- Usage examples and code samples
23+
- Best practices guide
24+
- Implementation reference
25+
- Quick reference index
26+
27+
## [1.0.0] - 2024-09-19
28+
29+
### Added
30+
- Initial release with core design pattern implementations
31+
- Basic documentation structure
32+
- Maven project setup
33+
- Command-line interface for pattern demonstrations
34+
35+
### Patterns Implemented
36+
- **Creational**: Singleton, Factory Method, Builder, Abstract Factory, Prototype
37+
- **Structural**: Adapter, Bridge, Composite, Decorator
38+
- **Behavioral**: Observer, Strategy, Command, State, Template Method, Chain of Responsibility
39+
40+
---
41+
42+
## Types of changes
43+
- `Added` for new features
44+
- `Changed` for changes in existing functionality
45+
- `Deprecated` for soon-to-be removed features
46+
- `Removed` for now removed features
47+
- `Fixed` for any bug fixes
48+
- `Security` in case of vulnerabilities
49+
50+
## Contributing
51+
When contributing to this project, please update the changelog accordingly.

CONTRIBUTING.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# Contributing to Design Patterns and Frameworks
2+
3+
Thank you for your interest in contributing to this educational project! 🎓
4+
5+
This project aims to provide comprehensive, professional-grade implementations of design patterns with extensive documentation and testing. We welcome contributions that enhance the educational value, code quality, or documentation.
6+
7+
## 📋 Table of Contents
8+
9+
- [Code of Conduct](#code-of-conduct)
10+
- [Getting Started](#getting-started)
11+
- [Development Process](#development-process)
12+
- [Contribution Guidelines](#contribution-guidelines)
13+
- [Documentation Standards](#documentation-standards)
14+
- [Testing Requirements](#testing-requirements)
15+
- [Pull Request Process](#pull-request-process)
16+
17+
## 🤝 Code of Conduct
18+
19+
This project follows a professional and respectful code of conduct. Please be respectful to all contributors and maintain a positive learning environment.
20+
21+
## 🚀 Getting Started
22+
23+
### Prerequisites
24+
- Java 8 or higher
25+
- Apache Maven 3.6+
26+
- Git
27+
- IDE (IntelliJ IDEA, Eclipse, VS Code recommended)
28+
29+
### Setup
30+
1. Fork the repository
31+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/design-patterns-frameworks.git`
32+
3. Navigate to project: `cd "Design Pattern et Frameworks"`
33+
4. Compile: `mvn clean compile`
34+
5. Verify installation: `java -cp "target/classes" ch.hearc.patterns.Main`
35+
36+
## 🔄 Development Process
37+
38+
1. **Choose an Issue**: Look for open issues or create a new one
39+
2. **Create a Branch**: Use descriptive branch names (`feature/add-new-pattern`, `fix/bug-description`)
40+
3. **Make Changes**: Follow the coding standards
41+
4. **Test Thoroughly**: Ensure all tests pass
42+
5. **Update Documentation**: Add or update relevant docs
43+
6. **Submit Pull Request**: Follow the PR template
44+
45+
## 📝 Contribution Guidelines
46+
47+
### Code Style
48+
- Follow Java naming conventions
49+
- Use meaningful variable and method names
50+
- Add JavaDoc comments for public APIs
51+
- Keep methods focused on single responsibilities
52+
- Use proper exception handling
53+
54+
### Pattern Implementation Standards
55+
- Implement complete pattern structure
56+
- Include real-world usage examples
57+
- Add performance considerations
58+
- Ensure thread safety where applicable
59+
- Provide comprehensive error handling
60+
61+
### Example Structure for New Patterns
62+
```java
63+
package ch.hearc.patterns.category;
64+
65+
/**
66+
* [Pattern Name] Pattern Implementation
67+
*
68+
* [Detailed description of the pattern]
69+
*
70+
* @author Your Name
71+
* @version 1.0
72+
*/
73+
public class PatternName {
74+
// Implementation here
75+
}
76+
```
77+
78+
## 📚 Documentation Standards
79+
80+
### Pattern Documentation
81+
Each pattern must have:
82+
- **Purpose and Motivation**: Why and when to use the pattern
83+
- **Structure**: Class diagram and relationships
84+
- **Implementation**: Code examples and explanations
85+
- **Usage Examples**: Real-world scenarios
86+
- **Benefits and Trade-offs**: Performance considerations
87+
- **Related Patterns**: Connections to other patterns
88+
89+
### Documentation Files
90+
- Update `docs/PATTERN_INDEX.md` for new patterns
91+
- Create individual pattern documentation in `docs/`
92+
- Update main README.md if needed
93+
- Maintain table of contents accuracy
94+
95+
## 🧪 Testing Requirements
96+
97+
### Unit Tests
98+
- Test all public methods
99+
- Include edge cases and error conditions
100+
- Use descriptive test names
101+
- Achieve high code coverage
102+
103+
### Integration Tests
104+
- Test pattern combinations
105+
- Verify end-to-end functionality
106+
- Include performance benchmarks
107+
108+
### Test Structure
109+
```java
110+
public class PatternTest {
111+
@Test
112+
public void testPatternFunctionality() {
113+
// Arrange
114+
// Act
115+
// Assert
116+
}
117+
}
118+
```
119+
120+
## 🔄 Pull Request Process
121+
122+
1. **Update CHANGELOG.md**: Add your changes to the unreleased section
123+
2. **Update Documentation**: Ensure all docs reflect your changes
124+
3. **Run Tests**: All tests must pass locally
125+
4. **Code Review**: Request review from maintainers
126+
5. **Merge**: Maintainers will merge approved PRs
127+
128+
### PR Template
129+
```
130+
## Description
131+
Brief description of changes
132+
133+
## Type of Change
134+
- [ ] New pattern implementation
135+
- [ ] Bug fix
136+
- [ ] Documentation update
137+
- [ ] Performance improvement
138+
- [ ] Test addition
139+
140+
## Testing
141+
- [ ] Unit tests added/updated
142+
- [ ] Integration tests pass
143+
- [ ] Manual testing completed
144+
145+
## Documentation
146+
- [ ] README updated
147+
- [ ] Pattern docs added/updated
148+
- [ ] CHANGELOG updated
149+
```
150+
151+
## 🎯 Areas for Contribution
152+
153+
### High Priority
154+
- Additional design pattern implementations
155+
- Performance optimizations
156+
- Thread safety improvements
157+
- Enhanced error handling
158+
159+
### Medium Priority
160+
- More comprehensive testing
161+
- Additional documentation examples
162+
- Code refactoring and cleanup
163+
- Performance monitoring enhancements
164+
165+
### Low Priority
166+
- UI improvements (if applicable)
167+
- Additional language support
168+
- Integration with other frameworks
169+
170+
## 📞 Getting Help
171+
172+
- **Issues**: Use GitHub issues for bugs and feature requests
173+
- **Discussions**: Use GitHub discussions for questions
174+
- **Documentation**: Check the `docs/` directory first
175+
176+
## 🙏 Recognition
177+
178+
Contributors will be recognized in:
179+
- CHANGELOG.md for significant contributions
180+
- README.md contributors section
181+
- GitHub repository contributors
182+
183+
Thank you for contributing to this educational resource! 🚀

0 commit comments

Comments
 (0)