mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 20:14:59 +00:00
* 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:
1 parent
ec80239e5e
commit
2d54709d1a
12 files changed
+642
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
@@ -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
|
||||
Reference in new issue
Block a user