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>
This commit is contained in:
FinnS-FandFinn authored and GitHub committed 2024-03-10 10:55:18 +02:00
1 parent ec80239e5e
commit 2d54709d1a
12 files changed
+642

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

+43
View File
@@ -0,0 +1,43 @@
@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