Re: How do I handle data that needs to be interpreted?
jlembke <lembkebus <at> comcast.net>
2009-08-03 19:15:45 GMT
Core numbers are a part of the domain, but the definitions for them live in another system (AS400
invoicing). We don't want to move that data to our new DB system because then we would have to manage those
numbers in two places. The new system manages return requests, which need to reference those numbers.
When the user inputs a request, all they have available is the part number, yet the $ for returns is based on
the core. Several parts may share the same core number.
So, we allow users to enter part numbers, and then we translate that part number to a core number by going to
the invoicing system. Once we have the core number, we no longer care about the part number.
So how do I regard the need to do this translation?
--- In domaindrivendesign <at> yahoogroups.com, Kurt Häusler <kurt.haeusler@...> wrote:
>
> Should "Core Number" not already be part of the "Core" entity? Or are we
> talking about creating new Cores here? If the latter, where do core
> numbers usually come from, in domain terms?
>
> "get the appropriate core information from a database" sounds like you
> are either getting this information from outside your domain, or you are
> mixing some data centric design in there.
>
> Do you have a db table just for mapping part numbers to core numbers? If
> so I would look at moving them into the domain if possible, otherwise as
> last resort a separate db lookup could work. Now if this is some
> external system, i.e. a different database to where your domain is
> persisted, say some public third party service, then this could be
> encapsulated as domain logic, call it a service if you like, and called
> from within the domain. The other option would be to create a separate
> repository just for this bit of data, and treat it as an aggregate, but
> this smells like it should just be part of the core entity in the first
> place.
>
>
>
> jlembke wrote:
> > Not sure how to forumulate that question, so here's the situation:
> >
> > My Aggregate contains a list of what are called "cores". (if you've ever bought an automotive *part* you
frequently pay a "core charge" which is similar to a deposit. A used automotive part is referred to as a
core, and can in some cases be returned to get the deposit back.
> >
> > Core numbers and part numbers are different. And my Domain Aggregate must deal with core numbers. The
problem is, users don't know core numbers, just part numbers. So before I can work with my domain
Aggregate, I have to take the Part number input by the user, and get the appropriate core information from a database.
> >
> > The question is, how do I handle getting the Core number, which I need to do in order to build my Domain
Aggregate? Do I just use a service to one-off that bit of needed knowledge and hit the database outside all
my repositories? what is a clean way to do this?
> >
> >
>
------------------------------------