Nathan Ridley
Nathan Ridley

Reputation: 34396

What's the best name for this interface?

I have an interface that defines the ability to persist an entity to a data store. I'm having trouble thinking of a name for it. Any ideas?

public interface IInterfaceForDefiningADataPersistenceOperation<T>
{
    void Store(T entity);
}

Upvotes: 2

Views: 328

Answers (9)

d91-jal
d91-jal

Reputation: 1017

If your interface follows the repository pattern then I would go with IRepository.

If not then perhaps IDataMapper is more suitable.

Upvotes: 0

Kris
Kris

Reputation: 41857

I'd go for IStorable

Upvotes: 1

marklam
marklam

Reputation: 5358

IPersistEntities

Then you can derive class MyNewPersistenceThing : IPersistEntities

Upvotes: 1

Roman
Roman

Reputation: 66176

IGateway

Then implementations are (for example): UserGateway, ArticleGateway and so on

Upvotes: 0

Will Dean
Will Dean

Reputation: 39520

Wouldn't an interface be defining a group of operations, rather than 'an operation'?

Upvotes: 0

Cᴏʀʏ
Cᴏʀʏ

Reputation: 107546

Did you not like any of these?

  • IPersistenceOperation
  • IDataStoreOperation
  • IEntityStoreOperation

Upvotes: 1

Garry Shutler
Garry Shutler

Reputation: 32698

public interface IPersistenceStrategy<T>

I'm taking a leap and saying you're using the strategy pattern in order to persist things in different ways depending on the strategy you provide.

Upvotes: 2

Marc Gravell
Marc Gravell

Reputation: 1063198

How about IFooRepository, where Foo is some base-entity or describes the product. If it truly is generic, then perhaps just IRepository<T>

Upvotes: 8

Mitch Wheat
Mitch Wheat

Reputation: 300669

IRepository ?

Upvotes: 15

Related Questions