Files
java-design-patterns/gateway/etc/gateway.urm.puml
T
FinnS-F 2d54709d1a feature: Add gateway pattern (#1297) (#2734)
* Implement Gateway pattern

* Fixed docstrings

* Fixed README.md

* Fixed App

* Fixed pom.xml

* Fixed pom.xml

* Fixed pom.xml

* Fixed pom.xml

* fixed checkstyle errors and directory names

* fixed pom.xml

* fixed checkstyle errors

* Bug fixed

* Bug fixed

* Bug fixed

* Bug fixed and code improvement

* Bug fixed and code improvement

* Bug fixed and update README.md

* update APP.java

* update gateway pattern

* Revert "update gateway pattern"

This reverts commit f31a00c268889b2c6b7690e07847df7247725999.

* update gateway pattern

---------

Co-authored-by: Finn <u7552286@anu.edu.au>
2024-03-10 10:55:18 +02:00

44 lines
813 B
Plaintext

@startuml GatewayPattern
package com.iluwatar.gateway{
class App {
+main(args: String[]): void
}
class GatewayFactory {
-gateways: Map<String, Gateway>
+registerGateway(key: String, gateway: Gateway): void
+getGateway(key: String): Gateway
}
interface Gateway {
{abstract} +execute(): void
}
class ExternalServiceA {
+execute(): void
}
class ExternalServiceB {
+execute(): void
}
class ExternalServiceC {
+execute(): void
+error(): void
}
App --> GatewayFactory : Uses
GatewayFactory --> Gateway : Creates
GatewayFactory --> ExternalServiceA : Registers
GatewayFactory --> ExternalServiceB : Registers
GatewayFactory --> ExternalServiceC : Registers
ExternalServiceA --> Gateway : Implements
ExternalServiceB --> Gateway : Implements
ExternalServiceC --> Gateway : Implements
@enduml