-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
11,649 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Design Patterns Implementation | ||
|
||
This document outlines the key design patterns used in our portfolio project, including their implementation details and rationale. | ||
|
||
## Core Design Patterns Used | ||
|
||
### 1. Repository Pattern | ||
- **Where**: Data access layer for Projects, Profile, and Messages | ||
- **Why**: Abstracts database operations, making it easier to switch databases or add caching | ||
- **Implementation**: | ||
|
||
### 2. Factory Pattern | ||
- **Where**: Creating Project and Technology instances | ||
- **Why**: Standardizes object creation, especially for different project types | ||
- **Implementation**: | ||
|
||
### 3. Observer Pattern | ||
- **Where**: Analytics tracking and project updates | ||
- **Why**: Enables real-time updates and loose coupling between components | ||
- **Implementation**: | ||
|
||
### 4. Singleton Pattern | ||
- **Where**: Database connection, Authentication service | ||
- **Why**: Ensures single instance for critical services | ||
- **Implementation**: | ||
|
||
### 5. Strategy Pattern | ||
- **Where**: Image upload handling | ||
- **Why**: Allows switching between different storage solutions | ||
- **Implementation**: | ||
|
||
### 7. Command Pattern | ||
- **Where**: Project actions (create, update, delete) | ||
- **Why**: Encapsulates requests as objects | ||
- **Implementation**: | ||
|
||
## Additional Patterns | ||
|
||
### 6. Decorator Pattern | ||
- **Where**: Authentication and logging middleware | ||
- **Why**: Adds functionality to existing objects dynamically | ||
- **Implementation**: | ||
|
||
## Usage Guidelines | ||
|
||
1. Always use the Repository Pattern for data access | ||
2. Implement Factory Pattern for creating complex objects | ||
3. Use Observer Pattern for loose coupling in event-driven scenarios | ||
4. Implement Strategy Pattern when multiple algorithms might be used | ||
5. Use Singleton Pattern sparingly and only for true global state | ||
|
||
## Benefits | ||
|
||
- Maintainable and scalable code structure | ||
- Easier testing through dependency injection | ||
- Flexible architecture that can adapt to changing requirements | ||
- Clear separation of concerns | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
/.env | ||
*.env | ||
.env.* | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
File renamed without changes.
Oops, something went wrong.