I'm working on a system to model a Process. One property of the Process is its rate. I think the Rate is a value object since it has no specific identity. This rate is retrieved from a service (think SOA, not DDD Service) I don't own. The service can vary for each type of Process, since the Processes have teams and services built to support them that hold the data I want. How do I organize that in DDD?
Here's some code to help explain:
class Process
{
private final Rate rate;
...
public Process( Rate rate )
{
this.rate = rate;
}
public Rate getRate()
{
return this.rate;
}
...
}
class ProcessFactory
{
public Process createProcess( ProcessSpecification spec );
}
class ProcessRepository
{
public Process getProcessByName( String name );
}
If ProcessSpecification includes a RateSpecification that describes which service to call for rates, should the ProcessRepository be responsible for knowing how to load rates from the various other services?