It is not my intention to participate in debates on verification in DDD, where the code belongs, etc., but to focus on one of the possible approaches and how to solve localization problems. I have the following behavior (method) on one of my domain objects (objects) that illustrate the scenario:
public void ClockIn()
{
if (WasTerminated)
{
throw new InvalidOperationException("Cannot clock-in a terminated employee.");
}
ClockedInAt = DateTime.Now;
:
}
As you can see, when the ClockIn method is called, the method checks the state of the object to ensure that Employee has not been interrupted. If the Employee has been terminated, we raise an exception consistent with the “Do not allow your entities to enter an invalid status” approach.
, . ( ) (ILocalizationService), MEF , . , DI, / , . DDD.
, , DDD, , , . , , , ?
, - /. , - DDD.
UPDATE
, , ( ILocalizationService). Visual Studio .
, , RESTful. , -. , , , .. ( ), , HTTP , (Accept-Language).