Prawidłowo zaprojektuj agregację korzeni
Mam pewne problemy przy projektowaniu agregującego roota. Oto, jak to widzę w moim umyśle :)
Store (the aggregate root)
-> Sales - A store create a sale every day
-> Zones - A store is divided into zones
-> Styles - A zone has x number of styles
--> Colors - A style has x number of colors
etc..
Teraz na tej podstawie moim zbiorczym korzeniem byłby sklep. Gdybym jednak miał teraz stworzyć repozytorium, wyglądałoby to tak?
public class StoreRepository()
{
Store GetById() {...}
StoreZone GetZone() {...}
List<StoreZoneStyle> GetStylesByZone() {...}
List<Color> GetColorsByStyle() {...}
}
Czy to dobry sposób na kontynuowanie? Nie trzeba dodawać, że jestem nowy w DDD.