我有一个接口,它定义了将实体持久存储到数据存储的能力。我很难为它命名。有任何想法吗?这个界面的名字是什么?
public interface IInterfaceForDefiningADataPersistenceOperation<T>
{
void Store(T entity);
}
我有一个接口,它定义了将实体持久存储到数据存储的能力。我很难为它命名。有任何想法吗?这个界面的名字是什么?
public interface IInterfaceForDefiningADataPersistenceOperation<T>
{
void Store(T entity);
}
IRepository
?
IFooRepository
怎么样,其中Foo
是一些基本实体或描述产品。如果它确实是通用的,那么也许只是IRepository<T>
public interface IPersistenceStrategy<T>
我正在飞跃,说你为了坚持根据您提供的战略方式不同的东西使用strategy pattern。
你不喜欢这些吗?
岂不接口是定义一组操作,而不是 '动作'?
IGateway
然后实现方式(例如): UserGateway,ArticleGateway等
IPersistEntities
然后你就可以派生类MyNewPersistenceThing:IPersistEntities
我会去IStorable
如果您的接口遵循repository pattern那么我会去与IRepository。如果不是,那么IDataMapper可能更适合。
不应该也有一个检索功能? – jmucchiello 2009-05-05 13:46:33
通常,是的,虽然我的应用程序的性质意味着数据操作与标准稍有不同。 – 2009-05-05 16:01:39