No Dirty Flag Checking

Aug 21, 2008 at 3:16 PM
Edited Aug 21, 2008 at 3:19 PM
Hi Tim,

In the class SmartCA.Infrastructure.Repositories.ChangeOrderRepository when you call the method PersistUpdatedItem(ChangeOrder item) you delete the list of RoutingItems and then add them back into the database like so:

// Now do the child objects

// First, delete the existing ones
this.DeleteRoutingItems(item);

// Now, add the current ones
this.InsertRoutingItems(item);

Is there a reason why you didn't choose to have dirty flags on your entities so that you would know which have changed so that you could save them? Did you decide it was better to do this instead of having the overhead of writing code to keep track if an object is dirty?

I guess not having code to check changing properties in your domain objects helps to keep them POCO.

Cheers
Scott