Take the 2-minute tour ×

In DDD examples I often see the use of methods where I would probably have used a property. Why is this?

For example (from Strengthening your domain: Aggregate Construction)

public class Order
    public bool IsLocal()
       return Customer.Province == BillingProvince;
share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

One argument for choosing methods instead of properties is when there would be any code that does something. If it just returns some internal field value then use property. If it has any logic inside or does any calculation use method. This makes it clearer to client of code that there is something happening when you call this method.

I think I've read in CLR via CSharp that Microsoft regrets making DateTime.Now a property instead of method. It returns new value every time you call it. That should be method not property.

share|improve this answer
Agreed. Probably it's just the contrived examples causing this. No real DDD reason. –  Robert Massa Jan 8 '12 at 14:49
add comment

Your Answer


