docs: Prepare for new website launch (#2149)

* Changed database implementation. Removed static objects.

* Fix Logs

* Fix 40 errors from checkstyle plugin run. 139 left))

* Fix CacheStore errors from checkstyle plugin 107 left

* Fix last errors in checkstyle.

* Fix sonar issues

* Fix issues in VALIDATE phase

* Fix Bug with mongo connection. Used "Try with resources"

* Add test

* Added docker-compose for mongo db. MongoDb db work fixed.

* Provided missing tests

* Comments to start Application with mongo.

* Fix some broken links

* Remove extra space

* Update filename

* Fix some links in localization folders

* Fix link

* Update frontmatters

* Work on patterns index page

* Work on index page

* Fixes according PR comments. Mainly Readme edits.

* fix frontmatter

* add missing png

* Update pattern index.md

* Add index.md for Chinese translation

* update image paths

* update circuit breaker image paths

* Update image paths for localizations

* add generated puml

* Add missing image

* Update img file extensions

* Update the rest of the EN and ZH patterns to conform with the new website

Co-authored-by: Victor Zalevskii <zvictormail@gmail.com>
This commit is contained in:
Ilkka Seppälä
2022-10-23 16:29:49 +03:00
committed by GitHub
co-authored by Victor Zalevskii
parent 00a40e6728
commit 4108f86177
273 changed files with 598 additions and 898 deletions
+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Adapter
folder: adapter
permalink: /patterns/adapter/ko
categories: Structural
category: Structural
language: ko
tags:
- Gang of Four
@@ -96,7 +93,7 @@ captain.row();
## 클레스 다이어그램
![alt text](https://github.com/warp125/java-design-patterns/blob/master/adapter/etc/adapter.urm.png?raw=true)
![alt text](etc/adapter.urm.png)
## 적용 가능성
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Factory
folder: factory
permalink: /patterns/factory/ko
categories: Creational
category: Creational
language: ko
tags:
- Gang of Four
@@ -107,7 +104,7 @@ This Ferrari.
## 클래스 다이어그램
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/factory/etc/factory.urm.png)
![alt text](etc/factory.urm.png)
## 적용 가능성
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Observer
folder: observer
permalink: /patterns/observer/ko
categories: Behavioral
category: Behavioral
language: ko
tags:
- Gang Of Four
@@ -137,7 +134,7 @@ The hobbits are facing sunny weather now
## 클래스 다이어그램
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/observer/etc/observer.png)
![alt text](etc/observer.png)
## 적용 가능성
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Prototype
folder: prototype
permalink: /patterns/prototype/ko
categories: Creational
category: Creational
language: ko
tags:
- Gang Of Four
@@ -67,7 +64,7 @@ System.out.println(cloned.getName()); // Dolly
## 클래스 다이어그램
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/prototype/etc/prototype.urm.png)
![alt text](etc/prototype.urm.png)
## 적용 가능성
Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Singleton
folder: singleton
permalink: /patterns/singleton/ko
categories: Creational
category: Creational
language: ko
tags:
- Gang of Four
@@ -49,7 +46,7 @@ assertEquals(enumIvoryTower1, enumIvoryTower2); // true
## 클래스 다이어그램
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/singleton/etc/singleton.urm.png)
![alt text](etc/singleton.urm.png)
## 적용 가능성
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Strategy
folder: strategy
permalink: /patterns/strategy/ko
categories: Behavioral
category: Behavioral
language: ko
tags:
- Gang of Four
@@ -163,7 +160,7 @@ public class LambdaStrategy {
## 클래스 다이어그램
![alt text](../../../strategy/etc/strategy_urm.png "Strategy")
![alt text](etc/strategy_urm.png "Strategy")
## 적용 가능성
Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Singleton
folder: singleton
permalink: /patterns/singleton/tr
categories: Creational
category: Creational
language: tr
tags:
- Gang of Four
@@ -51,7 +48,7 @@ assertEquals(enumIvoryTower1, enumIvoryTower2); // true
## Sınıf diagramı
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/singleton/etc/singleton.urm.png)
![alt text](etc/singleton.urm.png)
## Uygulanabilirlik
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Abstract Document
folder: abstract-document
permalink: /patterns/abstract-document/
categories: Structural
category: Structural
language: zh
tags:
- Extensibility
@@ -166,7 +163,7 @@ public class Car extends AbstractDocument implements HasModel, HasPrice, HasPart
## 类图
![alt text](../../../abstract-document/etc/abstract-document.png "Abstract Document Traits and Domain")
![alt text](etc/abstract-document.png "Abstract Document Traits and Domain")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Abstract Factory
folder: abstract-factory
permalink: /patterns/abstract-factory/
categories: Creational
category: Creational
language: zh
tags:
- Gang of Four
@@ -168,7 +165,7 @@ public static void main(String[] args) {
## 类图
![alt text](../../../abstract-factory/etc/abstract-factory.urm.png "Abstract Factory class diagram")
![alt text](etc/abstract-factory.urm.png "Abstract Factory class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Active Object
folder: active-object
permalink: /patterns/active-object/
categories: Concurrency
category: Concurrency
language: zh
tags:
- Performance
@@ -122,4 +119,4 @@ public class Orc extends ActiveCreature {
## 类图
![alt text](../../../active-object/etc/active-object.urm.png "Active Object class diagram")
![alt text](etc/active-object.urm.png "Active Object class diagram")
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Acyclic Visitor
folder: acyclic-visitor
permalink: /patterns/acyclic-visitor/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Extensibility
@@ -123,7 +120,7 @@ public class ConfigureForUnixVisitor implements ZoomVisitor {
## 类图
![alt text](../../../acyclic-visitor/etc/acyclic-visitor.png "Acyclic Visitor")
![alt text](etc/acyclic-visitor.png "Acyclic Visitor")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Adapter
folder: adapter
permalink: /patterns/adapter/
categories: Structural
category: Structural
language: zh
tags:
- Gang of Four
@@ -94,7 +91,7 @@ captain.row();
```
## 类图
![alt text](../../../adapter/etc/adapter.urm.png "Adapter class diagram")
![alt text](etc/adapter.urm.png "Adapter class diagram")
## 应用
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@@ -1,9 +1,6 @@
---
layout: pattern
title: Aggregator Microservices
folder: aggregator-microservices
permalink: /patterns/aggregator-microservices/
categories: Architectural
category: Architectural
language: zh
tags:
- Cloud distributed
@@ -95,7 +92,7 @@ curl http://localhost:50004/product
## 类图
![alt text](../../../aggregator-microservices/aggregator-service/etc/aggregator-service.png "Aggregator Microservice")
![alt text](etc/aggregator-service.png "Aggregator Microservice")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Ambassador
folder: ambassador
permalink: /patterns/ambassador/
categories: Structural
category: Structural
language: zh
tags:
- Decoupling
@@ -167,7 +164,7 @@ Service result: -1
## 类图
![alt text](../../../ambassador/etc/ambassador.urm.png "Ambassador class diagram")
![alt text](etc/ambassador.urm.png "Ambassador class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: API Gateway
folder: api-gateway
permalink: /patterns/api-gateway/
categories: Architectural
category: Architectural
language: zh
tags:
- Cloud distributed
@@ -123,7 +120,7 @@ public class ApiGateway {
```
## 类图
![alt text](../../../api-gateway/etc/api-gateway.png "API Gateway")
![alt text](etc/api-gateway.png "API Gateway")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+1 -4
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Arrange/Act/Assert
folder: arrange-act-assert
permalink: /patterns/arrange-act-assert/
categories: Idiom
category: Idiom
language: zh
tags:
- Testing
@@ -1,9 +1,6 @@
---
layout: pattern
title: Async Method Invocation
folder: async-method-invocation
permalink: /patterns/async-method-invocation/
categories: Concurrency
category: Concurrency
language: zh
tags:
- Reactive
@@ -142,7 +139,7 @@ public static void main(String[] args) throws Exception {
# 类图
![alt text](../../../async-method-invocation/etc/async-method-invocation.png "Async Method Invocation")
![alt text](etc/async-method-invocation.png "Async Method Invocation")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Balking
folder: balking
permalink: /patterns/balking/
categories: Concurrency
category: Concurrency
language: zh
tags:
- Decoupling
@@ -111,7 +108,7 @@ public interface DelayProvider {
## 类图
![alt text](../../../balking/etc/balking.png "Balking")
![alt text](etc/balking.png "Balking")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Bridge
folder: bridge
permalink: /patterns/bridge/
categories: Structural
category: Structural
language: zh
tags:
- Gang of Four
@@ -184,7 +181,7 @@ hammer.unwield();
## 类图
![alt text](../../../bridge/etc/bridge.urm.png "Bridge class diagram")
![alt text](etc/bridge.urm.png "Bridge class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Builder
folder: builder
permalink: /patterns/builder/
categories: Creational
category: Creational
language: zh
tags:
- Gang of Four
@@ -114,7 +111,7 @@ var mage = new Hero.Builder(Profession.MAGE, "Riobard").withHairColor(HairColor.
## 类图
![alt text](../../../builder/etc/builder.urm.png "Builder class diagram")
![alt text](etc/builder.urm.png "Builder class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Business Delegate
folder: business-delegate
permalink: /patterns/business-delegate/
categories: Structural
category: Structural
language: zh
tags:
- Decoupling
@@ -132,7 +129,7 @@ public class MobileClient {
## 类图
![alt text](../../../business-delegate/etc/business-delegate.urm.png "Business Delegate")
![alt text](etc/business-delegate.urm.png "Business Delegate")
## 相关模式
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Bytecode
folder: bytecode
permalink: /patterns/bytecode/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Game programming
@@ -214,7 +211,7 @@ public class VirtualMachine {
## 类图
![alt text](../../../bytecode/etc/bytecode.urm.png "Bytecode class diagram")
![alt text](etc/bytecode.urm.png "Bytecode class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Caching
folder: caching
permalink: /patterns/caching/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Performance
@@ -14,7 +11,7 @@ tags:
为了避免昂贵的资源重新获取,方法是在资源使用后不立即释放资源。资源保留其身份,保留在某些快速访问的存储中,并被重新使用,以避免再次获取它们。
## 类图
![alt text](../../../caching/etc/caching.png "Caching")
![alt text](etc/caching.png "Caching")
## 适用性
在以下情况下使用缓存模式
Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Callback
folder: callback
permalink: /patterns/callback/
categories: Idiom
category: Idiom
language: zh
tags:
- Reactive
@@ -69,7 +66,7 @@ public final class SimpleTask extends Task {
task.executeWith(() -> LOGGER.info("I'm done now."));
```
## 类图
![alt text](../../../callback/etc/callback.png "Callback")
![alt text](etc/callback.png "Callback")
## 适用性
使用回调模式当
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Chain of responsibility
folder: chain
permalink: /patterns/chain/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Gang of Four
@@ -139,7 +136,7 @@ king.makeRequest(new Request(RequestType.COLLECT_TAX, "collect tax")); // Orc so
```
## 类图
![alt text](../../../chain-of-responsibility/etc/chain-of-responsibility.urm.png "Chain of Responsibility class diagram")
![alt text](etc/chain-of-responsibility.urm.png "Chain of Responsibility class diagram")
## 适用性
使用责任链模式当
Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

+4 -7
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Circuit Breaker
folder: circuit-breaker
permalink: /patterns/circuit-breaker/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Performance
@@ -40,7 +37,7 @@ remote calls.
服务架构如下:
![alt text](../../../circuit-breaker/etc/ServiceDiagram.png "Service Diagram")
![alt text](etc/ServiceDiagram.png "Service Diagram")
在代码方面,最终用户应用程序是:
@@ -281,7 +278,7 @@ public class DefaultCircuitBreaker implements CircuitBreaker {
上述模式如何防止失败? 让我们通过它实现的这个有限状态机来理解。
![alt text](../../../circuit-breaker/etc/StateDiagram.png "State Diagram")
![alt text](etc/StateDiagram.png "State Diagram")
- 我们使用某些参数初始化断路器对象:`timeout``failureThreshold``retryTimePeriod`,这有助于确定 API 的弹性。
- 最初,我们处于“关闭”状态,没有发生对 API 的远程调用。
@@ -291,7 +288,7 @@ public class DefaultCircuitBreaker implements CircuitBreaker {
## 类图
![alt text](../../../circuit-breaker/etc/circuit-breaker.urm.png "Circuit Breaker class diagram")
![alt text](etc/circuit-breaker.urm.png "Circuit Breaker class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

@@ -1,9 +1,6 @@
---
layout: pattern
title: Static Content Hosting
folder: cloud-static-content-hosting
permalink: /patterns/cloud-static-content-hosting/
categories: Cloud
category: Cloud
language: zh
tags:
- Cloud distributed
@@ -30,7 +27,7 @@ tags:
**示例**
![alt text](../../../cloud-static-content-hosting/etc/static-content-hosting.png "Static Content Hosting")
![alt text](etc/static-content-hosting.png "Static Content Hosting")
在这个例子中我们使用AWS S3创建一个静态网站,并利用 AWS Cloudfront 在全球范围内分发内容。
Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

@@ -1,9 +1,6 @@
---
layout: pattern
title: Collection Pipeline
folder: collection-pipeline
permalink: /patterns/collection-pipeline/
categories: Functional
category: Functional
language: zh
tags:
- Reactive
@@ -14,7 +11,7 @@ tags:
在函数式编程中,可以通过一系列较小的模块化函数或操作来编排复杂的操作。这一系列函数被称为函数组合。当一个数据集合流经一个函数组合时,它就成为一个集合管道。函数组合和集合管道是函数式编程中经常使用的两种设计模式。
## 类图
![alt text](../../../collection-pipeline/etc/collection-pipeline.png "Collection Pipeline")
![alt text](etc/collection-pipeline.png "Collection Pipeline")
## 适用场景
在以下场景适用集合管道模式:
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Command
folder: command
permalink: /patterns/command/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Gang of Four
@@ -222,7 +219,7 @@ goblin.printStatus();
```
## 类图
![alt text](../../../command/etc/command.png "Command")
![alt text](etc/command.png "Command")
## 适用性
使用命令模式当你想
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Composite Entity
folder: composite-entity
permalink: /patterns/composite-entity/
categories: Structural
category: Structural
language: zh
tags:
- Enterprise Integration Pattern
@@ -110,7 +107,7 @@ Arrays.stream(console.getData()).forEach(LOGGER::info);
## 类图
![alt text](../../../composite-entity/etc/composite_entity.urm.png "Composite Entity Pattern")
![alt text](etc/composite_entity.urm.png "Composite Entity Pattern")
## 适用场景
Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Composite
folder: composite
permalink: /patterns/composite/
categories: Structural
category: Structural
language: zh
tags:
- Gang of Four
@@ -154,7 +151,7 @@ elfMessage.print(); // Much wind pours from your mouth.
## 类图
![alt text](../../../composite/etc/composite.urm.png "Composite class diagram")
![alt text](etc/composite.urm.png "Composite class diagram")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Converter
folder: converter
permalink: /patterns/converter/
categories: Creational
category: Creational
language: zh
tags:
- Decoupling
@@ -86,7 +83,7 @@ var user = userConverter.convertFromDto(dtoUser);
## 类图
![alt text](../../../converter/etc/converter.png "Converter Pattern")
![alt text](etc/converter.png "Converter Pattern")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Data Access Object
folder: dao
permalink: /patterns/dao/
categories: Architectural
category: Architectural
language: zh
tags:
- Data access
@@ -149,7 +146,7 @@ customerDao.getAllCustomers(): java.util.stream.ReferencePipeline$Head@6ec8211c
## 类图
![alt text](../../../dao/etc/dao.png "Data Access Object")
![alt text](etc/dao.png "Data Access Object")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Data Bus
folder: data-bus
permalink: /patterns/data-bus/
categories: Architectural
category: Architectural
language: zh
tags:
- Decoupling
@@ -14,7 +11,7 @@ tags:
数据总线模式(译者:实际上,就是 Event-Bus 消息总线模式)允许在一个应用程序的组件之间收发消息/事件,而不需要这些组件相互感知,它们只需要知道所发送/接收的消息/事件的类型即可。
## 类图
![data bus pattern uml diagram](../../../data-bus/etc/data-bus.urm.png "Data Bus pattern")
![data bus pattern uml diagram](etc/data-bus.urm.png "Data Bus pattern")
## 适用场景
可以在以下场景使用数据总线模式:
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Data Mapper
folder: data-mapper
permalink: /patterns/data-mapper/
categories: Architectural
category: Architectural
language: zh
tags:
- Decoupling
@@ -13,7 +10,7 @@ tags:
一个用于在持久化对象和数据库之间传输数据的映射器,同时保持它们之间和映射器本身的独立性。
## 类图
![alt text](../../../data-mapper/etc/data-mapper.png "Data Mapper")
![alt text](etc/data-mapper.png "Data Mapper")
## 适用场景
数据映射器适用于以下场景:
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@@ -1,9 +1,6 @@
---
layout: pattern
title: Data Transfer Object
folder: data-transfer-object
permalink: /patterns/data-transfer-object/
categories: Architectural
category: Architectural
language: zh
tags:
- Performance
@@ -94,7 +91,7 @@ public class CustomerResource {
## 类图
![alt text](../../../data-transfer-object/etc/data-transfer-object.urm.png "data-transfer-object")
![alt text](etc/data-transfer-object.urm.png "data-transfer-object")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Decorator
folder: decorator
permalink: /patterns/decorator/
categories: Structural
category: Structural
language: zh
tags:
- Gang Of Four
@@ -106,7 +103,7 @@ clubbedTroll.fleeBattle(); // The troll shrieks in horror and runs away!
```
## 类图
![alt text](../../../decorator/etc/decorator.urm.png "Decorator pattern class diagram")
![alt text](etc/decorator.urm.png "Decorator pattern class diagram")
## 适用性
使用装饰者
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Delegation
folder: delegation
permalink: /patterns/delegation/
categories: Structural
category: Structural
language: zh
tags:
- Decoupling
@@ -16,7 +13,7 @@ tags:
它是一种让对象将某种行为向外部表达,但实际上将实现该行为的责任委托给关联对象的技术。
## 类图
![alt text](../../../delegation/etc/delegation.png "Delegate")
![alt text](etc/delegation.png "Delegate")
## 适用性
使用委托模式以实现以下目的
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@@ -1,9 +1,6 @@
---
layout: pattern
title: Dependency Injection
folder: dependency-injection
permalink: /patterns/dependency-injection/
categories: Creational
category: Creational
language: zh
tags:
- Decoupling
@@ -84,7 +81,7 @@ public class AdvancedWizard implements Wizard {
## 类图
![alt text](../../../dependency-injection/etc/dependency-injection.png "Dependency Injection")
![alt text](etc/dependency-injection.png "Dependency Injection")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Dirty Flag
folder: dirty-flag
permalink: /patterns/dirty-flag/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Game programming
@@ -17,7 +14,7 @@ tags:
避免昂贵资源的重新获取。资源保留其身份,保留在某些快速访问的存储中,并被重新使用以避免再次获取它们。
## 类图
![alt text](../../../dirty-flag/etc/dirty-flag.png "Dirty Flag")
![alt text](etc/dirty-flag.png "Dirty Flag")
## 适用性
在以下情况下使用脏标志模式
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

@@ -1,9 +1,6 @@
---
layout: pattern
title: Double Checked Locking
folder: double-checked-locking
permalink: /patterns/double-checked-locking/
categories: Idiom
category: Idiom
language: zh
tags:
- Performance
@@ -13,7 +10,7 @@ tags:
通过先测试锁定标准("锁提示")而不实际获取锁的方式来减少获取锁的开销。只有当锁定标准检查表明需要锁定时,才进行实际的锁定逻辑。
## 类图
![alt text](../../../double-checked-locking/etc/double_checked_locking_1.png "Double Checked Locking")
![alt text](etc/double_checked_locking_1.png "Double Checked Locking")
## 适用场景
在以下场景适合使用双重锁检查模式:
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Facade
folder: facade
permalink: /patterns/facade/
categories: Structural
category: Structural
language: zh
tags:
- Gang Of Four
@@ -189,7 +186,7 @@ facade.endDay();
```
## 类图
![alt text](../../../facade/etc/facade.urm.png "Facade pattern class diagram")
![alt text](etc/facade.urm.png "Facade pattern class diagram")
## 适用性
使用外观模式当
Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Factory Kit
folder: factory-kit
permalink: /patterns/factory-kit/
categories: Creational
category: Creational
language: zh
tags:
- Extensibility
@@ -13,7 +10,7 @@ tags:
使用分离的构建器和工厂接口来定义一个不可变内容的工厂。
## 类图
![alt text](../../../factory-kit/etc/factory-kit.png "Factory Kit")
![alt text](etc/factory-kit.png "Factory Kit")
## 适用场景
工厂套件模式适用于与以下场景:
Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Factory Method
folder: factory-method
permalink: /patterns/factory-method/
categories: Creational
category: Creational
language: zh
tags:
- Extensibility
@@ -63,7 +60,7 @@ blacksmith.manufactureWeapon(WeaponType.AXE);
```
## 类图
![alt text](../../../factory-method/etc/factory-method.urm.png "Factory Method pattern class diagram")
![alt text](etc/factory-method.urm.png "Factory Method pattern class diagram")
## 适用性
使用工厂方法模式当
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Factory
folder: factory
permalink: /patterns/factory/
categories: Creational
category: Creational
language: zh
tags:
- Gang of Four
@@ -109,7 +106,7 @@ This is Ferrari.
## 类图
![alt text](../../../factory/etc/factory.urm.png "Factory pattern class diagram")
![alt text](etc/factory.urm.png "Factory pattern class diagram")
## 适用场景
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+52
View File
@@ -0,0 +1,52 @@
| Pattern | Category | Tags |
| :--- | :--- | :--- |
| [Abstract Document](abstract-document) | Structural | Extensibility |
| [Abstract Factory](abstract-factory) | Creational | Gang of Four |
| [Active Object](active-object) | Concurrency | Performance |
| [Acyclic Visitor](acyclic-visitor) | Behavioral | Extensibility |
| [Adapter](adapter) | Structural | Gang of Four |
| [Aggregator Microservices](aggregator-microservices) | Architectural | Cloud distributed |
| [Ambassador](ambassador) | Structural | Decoupling |
| [API Gateway](api-gateway) | Architectural | Cloud distributed, Decoupling |
| [Arrange/Act/Assert](arrange-act-assert) | Idiom | Testing |
| [Async Method Invocation](async-method-invocation) | Concurrency | Reactive |
| [Balking](balking) | Concurrency | Decoupling |
| [Bridge](bridge) | Structural | Gang of Four |
| [Builder](builder) | Creational | Gang of Four |
| [Business Delegate](business-delegate) | Structural | Decoupling |
| [Bytecode](bytecode) | Behavioral | Game programming |
| [Caching](caching) | Behavioral | Performance |
| [Callback](callback) | Idiom | Reactive |
| [Chain of Responsibility](chain-of-responsibility) | Behavioral | Gang of Four |
| [Circuit Breaker](circuit-breaker) | Behavioral | Performance, Decoupling |
| [Cloud Static Content Hosting](cloud-static-content-hosting) | Cloud | Cloud distributed |
| [Collection Pipeline](collection-pipeline) | Functional | Reactive |
| [Command](command) | Behavioral | Gang of Four |
| [Composite](composite) | Structural | Gang of Four |
| [Composite Entity](composite-entity) | Structural | Enterprise Integration Pattern |
| [Converter](converter) | Creational | Decoupling |
| [Data Access Object](data-access-object) | Architectural | Data access |
| [Data Bus](data-bus) | Architectural | Decoupling |
| [Data Mapper](data-mapper) | Architectural | Decoupling |
| [Data Transfer Object](data-transfer-object) | Architectural | Performance |
| [Decorator](decorator) | Structural | Gang of Four, Extensibility |
| [Delegation](delegation) | Structural | Decoupling |
| [Dependency Injection](dependency-injection) | Creational | Decoupling |
| [Dirty Flag](dirty-flag) | Behavioral | Performance, Game programming |
| [Double Checked Locking](double-checked-locking) | Idiom | Performance |
| [Facade](facade) | Structural | Gang of Four, Decoupling |
| [Factory](factory) | Creational | Gang of Four |
| [Factory kit](factory-kit) | Creational | Extensibility |
| [Factory Method](factory-method) | Creational | Gang of Four, Extensibility |
| [Interpreter](interpreter) | Behavioral | Gang of Four |
| [Iterator](iterator) | Behavioral | Gang of Four |
| [Observer](observer) | Behavioral | Gang of Four, Reactive |
| [Private Class Data](private-class-data) | Idiom | Data access |
| [Producer Consumer](producer-consumer) | Concurrency | Reactive |
| [Proxy](proxy) | Structural | Gang of Four, Decoupling |
| [Sharding](sharding) | Behavioral | Performance, Cloud distributed |
| [State](state) | Behavioral | Gang of Four |
| [Strategy](strategy) | Behavioral | Gang of Four |
| [Template Method](table-module) | Behavioral | Gang of Four |
| [Version Number](version-number) | Concurrency | Data access, Microservices |
| [Visitor](visitor) | Behavioral | Gang of Four |
+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Interpreter
folder: interpreter
permalink: /patterns/interpreter/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Gang of Four
@@ -13,7 +10,7 @@ tags:
给定一种语言,请定义其语法的表示形式,以及使用该表示形式来解释该语言中的句子的解释器。
## 类图
![alt text](../../../interpreter/etc/interpreter_1.png "Interpreter")
![alt text](etc/interpreter_1.png "Interpreter")
## 适用性
有一种要解释的语言时,请使用解释器模式,并且可以将语言中的语句表示为抽象语法树。解释器模式在以下情况下效果最佳
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Iterator
folder: iterator
permalink: /patterns/iterator/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Gang of Four
@@ -115,7 +112,7 @@ while (itemIterator.hasNext()) {
```
## 类图
![alt text](../../../iterator/etc/iterator_1.png "Iterator")
![alt text](etc/iterator_1.png "Iterator")
## 适用性
以下情况使用迭代器模式
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Observer
folder: observer
permalink: /patterns/observer/
categories: Behavioral
category: Behavioral
language: zh
tags:
- Gang Of Four
@@ -129,7 +126,7 @@ public class Weather {
```
## Class diagram
![alt text](../../../observer/etc/observer.png "Observer")
![alt text](etc/observer.png "Observer")
## 应用
在下面任何一种情况下都可以使用观察者模式
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+2 -5
View File
@@ -1,9 +1,6 @@
---
layout: pattern
title: Private Class Data
folder: private-class-data
permalink: /patterns/private-class-data/
categories: Idiom
category: Idiom
language: zh
tags:
- Data access
@@ -120,7 +117,7 @@ immutableStew.mix(); // Mixing the immutable stew we find: 2 potatoes, 4 carrot
## 类图
![alt text](../../../private-class-data/etc/private-class-data.png "Private Class Data")
![alt text](etc/private-class-data.png "Private Class Data")
## 适用性
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Some files were not shown because too many files have changed in this diff Show More