docs: updates to several patterns

This commit is contained in:
Ilkka Seppälä committed 2024-05-28 19:46:39 +03:00
1 parent 4652842c94
commit 584e949714
70 files changed
+347 -479

No files matched your search

+4 -4
View File
@@ -50,14 +50,18 @@ public class ExternalServiceA implements Gateway {
// Implementation for ExternalServiceA
}
}
```
```java
public class ExternalServiceB implements Gateway {
@Override
public void execute() {
// Implementation for ExternalServiceB
}
}
```
```java
public class ExternalServiceC implements Gateway {
@Override
public void execute() {
@@ -122,10 +126,6 @@ Running the example produces the following output.
This example demonstrates how the Gateway design pattern can be used to simplify the interaction with multiple external services. Each service is encapsulated behind a common interface, and the application interacts with this interface rather than directly with the services. This reduces coupling and makes the application easier to maintain and extend.
## Class diagram
![Gateway](./etc/gateway.urm.png "Gateway")
## Applicability
Use the Gateway pattern when you need to integrate with remote services or APIs, and you want to minimize the coupling between your application and external systems. It is particularly useful in microservices architectures where different services need to communicate through well-defined APIs.