Files
Shahd Hossam 8cb7c9ada6 feat: Implementation of session facade design pattern #1278 (#3121)
* 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>
2025-01-11 17:45:01 +02:00

48 lines
1.3 KiB
Plaintext

@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