1
0
Fork 0
This commit is contained in:
IvisTang 2026-01-07 20:40:00 +08:00
parent c52431fb9d
commit 7572425590
2 changed files with 20 additions and 59 deletions

View File

@ -147,70 +147,50 @@ design-patterns/
### Go Implementation
1. Navigate to the Go directory:
```bash
cd go
```
2. Each pattern directory contains:
- Implementation files
- Example usage
- Tests (if applicable)
3. Run examples using:
2. Run examples using:
```bash
go run <pattern-name>/main.go
make
```
### Python Implementation
1. Navigate to the Python directory:
```bash
cd python
```
2. Each pattern directory contains:
- Implementation modules
- Example usage
- Tests (if applicable)
2. Run examples using:
3. Run examples using:
```bash
python -m <pattern-name>.main
make
```
### TypeScript Implementation
1. Navigate to the TypeScript directory:
```bash
cd ts
```
2. Install dependencies:
```bash
pnpm install
```
3. Each pattern directory contains:
- Implementation files
- Example usage
- Tests (if applicable)
3. Run examples using:
4. Run examples using:
```bash
pnpm run <pattern-name>
make
```
## Pattern Categories
### Creational Patterns
Creational patterns abstract the instantiation process. They help make a system independent of how its objects are created, composed, and represented.
### Structural Patterns
Structural patterns deal with the composition of classes or objects. They help ensure that when one part of a system changes, the entire system doesn't need to change.
### Behavioral Patterns
Behavioral patterns characterize the ways in which classes or objects interact and distribute responsibility. They focus on communication between objects.
## Contributing
Contributions are welcome! Here are some ways you can contribute:

View File

@ -147,70 +147,51 @@ design-patterns/
### Go 实现
1. 进入 Go 目录:
```bash
cd go
```
2. 每个模式目录包含:
- 实现文件
- 示例用法
- 测试(如适用)
2. 运行示例:
3. 运行示例:
```bash
go run <pattern-name>/main.go
make
```
### Python 实现
1. 进入 Python 目录:
```bash
cd python
```
2. 每个模式目录包含:
- 实现模块
- 示例用法
- 测试(如适用)
2. 运行示例:
3. 运行示例:
```bash
python -m <pattern-name>.main
make
```
### TypeScript 实现
1. 进入 TypeScript 目录:
```bash
cd ts
```
2. 安装依赖:
```bash
pnpm install
```
3. 每个模式目录包含:
- 实现文件
- 示例用法
- 测试(如适用)
3. 运行示例:
4. 运行示例:
```bash
pnpm run <pattern-name>
make
```
## 模式分类
### 创建型模式
创建型模式抽象了实例化过程。它们帮助系统独立于如何创建、组合和表示其对象。
### 结构型模式
结构型模式处理类或对象的组合。它们确保当系统的一部分发生变化时,整个系统不需要改变。
### 行为型模式
行为型模式描述类或对象如何交互和分配职责。它们专注于对象之间的通信。
## 贡献
欢迎贡献!您可以通过以下方式参与: