rendered paste body// Assembly1
public class DomainObject
{
protected void markDirty()
{
UnitOfWork.getCurrent.RegisterDirty(this);
}
}
//Assembly1
public class UnitOfWork
{
public void Commit()
{
foreach (DomainObject obj in _dirtyObjects)
{
IMapper mp = MapperRegistry.GetMapper(obj.GetType());
mp.Update(obj);
}
}
}
// Assembly1
public interface IMapper
{
void Update(DomainObject obj);
}
// Assembly2
public class DomainObjectMapper : IMapper
{
public void Update(DomainObject obj)
{
}
}
//Assembly3
public static class MapperRegistry
{
public static IMapper GetMapper(Type type)
{
}
}