What is a practical way to model lookup tables in Domain Driven Design (DDD)?

前端 未结 5 2083
青春惊慌失措
青春惊慌失措 2021-01-30 07:02

I\'m just learning DDD (Eric Evans book is open in front of me) and I\'ve come across a problem that I can\'t find an answer for. What do you do in DDD when you\'re just trying

5条回答
  •  情深已故
    2021-01-30 07:22

    Using DDD I have something similar with the following:

    interface IAddressService
    {
      IList GetCountries ();
      IList GetStatesByCountry (string country);
      IList GetCitiesByState (string state);
      // snip
    }
    

    Country, State and City are value objects which come from a lookup table in the database.

提交回复
热议问题