@startuml package com.iluwatar.layers.dto { class CakeInfo { + cakeLayerInfos : List + cakeToppingInfo : CakeToppingInfo + id : Optional + CakeInfo(cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List) + CakeInfo(id : Long, cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List) + calculateTotalCalories() : int + toString() : String } class CakeLayerInfo { + calories : int + id : Optional + name : String + CakeLayerInfo(id : Long, name : String, calories : int) + CakeLayerInfo(name : String, calories : int) + toString() : String } class CakeToppingInfo { + calories : int + id : Optional + 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 - topping : CakeTopping + Cake() + addLayer(layer : CakeLayer) + getId() : Long + getLayers() : Set + getTopping() : CakeTopping + setId(id : Long) + setLayers(layers : Set) + 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 {abstract} + getAvailableLayers() : List {abstract} + getAvailableToppings() : List {abstract} + saveNewLayer(CakeLayerInfo) {abstract} + saveNewTopping(CakeToppingInfo) {abstract} } class CakeBakingServiceImpl { - context : AbstractApplicationContext + CakeBakingServiceImpl() + bakeNewCake(cakeInfo : CakeInfo) + getAllCakes() : List - getAvailableLayerEntities() : List + getAvailableLayers() : List - getAvailableToppingEntities() : List + getAvailableToppings() : List + 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