Slide 6
Slide 6 text
Repositories
• Each entity should have it’s own repository. If the entity is read only so should be the
repository.
• All repositories must have their own interface and it might be useful to have abstract
repositories to decrease the amount of code to be written.
• Repository methods should be easily overriden for flexibility so we could make them
virtual but it’s not mandatory because C# let’s you override a method with the [new]
word on the function signature.
abstract class BaseRepository : IBaseRepository
abstract class ReadRepository : BaseRepository, IReadRepository
abstract class WriteRepository : ReadRepository, IWriteRepository
WritableEntityRepository : WriteRepository, IWritableEntityRepository
ReadOnlyEntityRepository : ReadRepository, IReadOnlyEntityRepository
projName.Data.Repositories
6
http://pt.linkedin.com/in/diogogcunha/