I am putting together a type-safe version of the Repository Pattern by passing both the entity type and its corresponding key type. The style question is should the key or the entity go first in the definition?
e.g.
VB.net Code:
''' <summary> ''' Interface to support reading entities from the backing store ''' </summary> ''' <typeparam name="TEntity"> ''' The key-identified type of entity we are reading ''' </typeparam> ''' <typeparam name="TKey"> ''' The type of the key ''' </typeparam> ''' <remarks> ''' In this architecture there is a seperate read and write interface but often this ''' pattern has just the one interface for both functions ''' </remarks> Public Interface IRepositoryRead(Of TEntity As IKeyedEntity(Of TKey), In TKey)
or
VB.net Code:
''' <summary> ''' Interface to support reading entities from the backing store ''' </summary> ''' <typeparam name="TEntity"> ''' The key-identified type of entity we are reading ''' </typeparam> ''' <typeparam name="TKey"> ''' The type of the key ''' </typeparam> ''' <remarks> ''' In this architecture there is a seperate read and write interface but often this ''' pattern has just the one interface for both functions ''' </remarks> Public Interface IRepositoryRead(Of In TKey, TEntity As IKeyedEntity(Of TKey))
Thoughts?




Reply With Quote