I am new to DDD, so please forgive me if I do not use these terms correctly.
I am using C # MS / SQL and NHibernate.
I have a call to the Payment class, and this payment has PaymentCurrency, each of which is an entity in the database.
OK In my domain model, I want to be able to create a "Payment" as "Either"
Payment p = new Payment( 100 )
or
Payment p = new Payment( 100, Repository.GetCurrency( "JPY" ) )
But it seems to me that in order to initialize my domain object with the dfault currency, I need to pollute the domain model with knowledge of durability. that is, before I can complete the default payment constructor, I need to load the "Default Payment" object from db.
The constructor that I am visualizing looks like
public Payment( int amount ) {
Currency = Repository.LoadDefaultCurrency();
}
public Payment( int amount, Currency c ) {
Currency = c;
}
Thanks for your advice.
thrag