开源项目 `design-pattern` 使用教程

开源项目 design-pattern 使用教程

design-patternDesign Patterns In Modern C++ 中文版翻译项目地址:https://gitcode.com/gh_mirrors/des/design-pattern

1. 项目的目录结构及介绍

design-pattern/
├── src/
│   ├── creational/
│   │   ├── abstract_factory.py
│   │   ├── builder.py
│   │   ├── factory_method.py
│   │   ├── prototype.py
│   │   └── singleton.py
│   ├── structural/
│   │   ├── adapter.py
│   │   ├── bridge.py
│   │   ├── composite.py
│   │   ├── decorator.py
│   │   ├── facade.py
│   │   ├── flyweight.py
│   │   └── proxy.py
│   └── behavioral/
│       ├── chain_of_responsibility.py
│       ├── command.py
│       ├── interpreter.py
│       ├── iterator.py
│       ├── mediator.py
│       ├── memento.py
│       ├── observer.py
│       ├── state.py
│       ├── strategy.py
│       ├── template_method.py
│       └── visitor.py
├── tests/
│   ├── test_creational.py
│   ├── test_structural.py
│   └── test_behavioral.py
├── README.md
├── requirements.txt
└── setup.py

目录结构说明

  • src/:包含所有设计模式的实现代码。
    • creational/:创建型设计模式。
    • structural/:结构型设计模式。
    • behavioral/:行为型设计模式。
  • tests/:包含所有测试文件。
  • README.md:项目说明文档。
  • requirements.txt:项目依赖文件。
  • setup.py:项目安装文件。

2. 项目的启动文件介绍

项目的启动文件通常是 src/ 目录下的某个文件,具体取决于你想要运行的设计模式。例如,如果你想运行单例模式,你可以使用以下命令:

python src/creational/singleton.py

3. 项目的配置文件介绍

项目中没有显式的配置文件,但可以通过 requirements.txt 文件来管理依赖项。你可以使用以下命令来安装所有依赖项:

pip install -r requirements.txt

这个文件列出了项目运行所需的所有Python包及其版本。

design-patternDesign Patterns In Modern C++ 中文版翻译项目地址:https://gitcode.com/gh_mirrors/des/design-pattern

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

羿晴汝Gillian

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值