mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-21 06:26:46 +00:00
* implementation of session facade #1278 * minor change * readme updated * addressed the comments regarding changing lists to maps and adding maven assembly plugin --------- Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
This commit is contained in:
co-authored by
Ilkka Seppälä
parent
bcad5b1aa3
commit
8cb7c9ada6
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
@@ -0,0 +1,48 @@
|
||||
@startuml
|
||||
package com.iluwatar.sessionfacade {
|
||||
class App {
|
||||
+ App()
|
||||
+ main(args : String[]) {static}
|
||||
}
|
||||
class CartService {
|
||||
- LOGGER : Logger {static}
|
||||
- cart : List<Product>
|
||||
- productCatalog : List<Product>
|
||||
+ CartService(cart : List<Product>, productCatalog : List<Product>)
|
||||
+ addToCart(productId : int)
|
||||
+ removeFromCart(productId : int)
|
||||
}
|
||||
class OrderService {
|
||||
- LOGGER : Logger {static}
|
||||
- cart : List<Product>
|
||||
+ OrderService(cart : List<Product>)
|
||||
+ order()
|
||||
}
|
||||
class PaymentService {
|
||||
+ LOGGER : Logger {static}
|
||||
+ PaymentService()
|
||||
+ cashPayment()
|
||||
+ creditCardPayment()
|
||||
+ selectPaymentMethod(method : String)
|
||||
}
|
||||
class ProductCatalogService {
|
||||
- products : List<Product>
|
||||
+ ProductCatalogService(products : List<Product>)
|
||||
}
|
||||
class ShoppingFacade {
|
||||
~ cart : List<Product>
|
||||
~ cartService : CartService
|
||||
~ orderService : OrderService
|
||||
~ paymentService : PaymentService
|
||||
~ productCatalog : List<Product>
|
||||
+ ShoppingFacade()
|
||||
+ addToCart(productId : int)
|
||||
+ order()
|
||||
+ removeFromCart(productId : int)
|
||||
+ selectPaymentMethod(method : String)
|
||||
}
|
||||
}
|
||||
ShoppingFacade --> "-cartService" CartService
|
||||
ShoppingFacade --> "-paymentService" PaymentService
|
||||
ShoppingFacade --> "-orderService" OrderService
|
||||
@enduml
|
||||
Reference in New Issue
Block a user