@startuml
package com.iluwatar.layers.dto {
  class CakeInfo {
    + cakeLayerInfos : List<CakeLayerInfo>
    + cakeToppingInfo : CakeToppingInfo
    + id : Optional<Long>
    + CakeInfo(cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List<CakeLayerInfo>)
    + CakeInfo(id : Long, cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List<CakeLayerInfo>)
    + calculateTotalCalories() : int
    + toString() : String
  }
  class CakeLayerInfo {
    + calories : int
    + id : Optional<Long>
    + name : String
    + CakeLayerInfo(id : Long, name : String, calories : int)
    + CakeLayerInfo(name : String, calories : int)
    + toString() : String
  }
  class CakeToppingInfo {
    + calories : int
    + id : Optional<Long>
    + name : String
    + CakeToppingInfo(id : Long, name : String, calories : int)
    + CakeToppingInfo(name : String, calories : int)
    + toString() : String
  }
}
package com.iluwatar.layers.entity {
  class Cake {
    - id : Long
    - layers : Set<CakeLayer>
    - topping : CakeTopping
    + Cake()
    + addLayer(layer : CakeLayer)
    + getId() : Long
    + getLayers() : Set<CakeLayer>
    + getTopping() : CakeTopping
    + setId(id : Long)
    + setLayers(layers : Set<CakeLayer>)
    + setTopping(topping : CakeTopping)
    + toString() : String
  }
  class CakeLayer {
    - cake : Cake
    - calories : int
    - id : Long
    - name : String
    + CakeLayer()
    + CakeLayer(name : String, calories : int)
    + getCake() : Cake
    + getCalories() : int
    + getId() : Long
    + getName() : String
    + setCake(cake : Cake)
    + setCalories(calories : int)
    + setId(id : Long)
    + setName(name : String)
    + toString() : String
  }
  class CakeTopping {
    - cake : Cake
    - calories : int
    - id : Long
    - name : String
    + CakeTopping()
    + CakeTopping(name : String, calories : int)
    + getCake() : Cake
    + getCalories() : int
    + getId() : Long
    + getName() : String
    + setCake(cake : Cake)
    + setCalories(calories : int)
    + setId(id : Long)
    + setName(name : String)
    + toString() : String
  }
}
package com.iluwatar.layers.view {
  class CakeViewImpl {
    - LOGGER : Logger {static}
    - cakeBakingService : CakeBakingService
    + CakeViewImpl(cakeBakingService : CakeBakingService)
    + render()
  }
  interface View {
    + render() {abstract}
  }
}
package com.iluwatar.layers.app {
  class App {
    - cakeBakingService : CakeBakingService {static}
    + App()
    - initializeData(cakeBakingService : CakeBakingService) {static}
    + main(args : String[]) {static}
  }
}
package com.iluwatar.layers.dao {
  interface CakeDao {
  }
  interface CakeLayerDao {
  }
  interface CakeToppingDao {
  }
}
package com.iluwatar.layers.service {
  interface CakeBakingService {
    + bakeNewCake(CakeInfo) {abstract}
    + getAllCakes() : List<CakeInfo> {abstract}
    + getAvailableLayers() : List<CakeLayerInfo> {abstract}
    + getAvailableToppings() : List<CakeToppingInfo> {abstract}
    + saveNewLayer(CakeLayerInfo) {abstract}
    + saveNewTopping(CakeToppingInfo) {abstract}
  }
  class CakeBakingServiceImpl {
    - context : AbstractApplicationContext
    + CakeBakingServiceImpl()
    + bakeNewCake(cakeInfo : CakeInfo)
    + getAllCakes() : List<CakeInfo>
    - getAvailableLayerEntities() : List<CakeLayer>
    + getAvailableLayers() : List<CakeLayerInfo>
    - getAvailableToppingEntities() : List<CakeTopping>
    + getAvailableToppings() : List<CakeToppingInfo>
    + saveNewLayer(layerInfo : CakeLayerInfo)
    + saveNewTopping(toppingInfo : CakeToppingInfo)
  }
}
CakeInfo -->  "-cakeLayerInfos" CakeLayerInfo
CakeInfo -->  "-cakeToppingInfo" CakeToppingInfo
CakeViewImpl -->  "-cakeBakingService" CakeBakingService
App -->  "-cakeBakingService" CakeBakingService
Cake -->  "-topping" CakeTopping
CakeLayer -->  "-cake" Cake
CakeBakingServiceImpl ..|> CakeBakingService 
CakeViewImpl ..|> View 
@enduml