The application i am currently working on makes heavy use of the repository pattern with NHibernate. We have a generic base repository class that implements standard gets and saves. This class is then inherited by repositories for each type. These repositories can then add their own type specific methods (and override saves and gets if neccesary).
This works well and from a seperation of concerns point of view means that our business objects are POCO's and our repository classes handle the specifics of saving. practically however it would be very useful when we have a type to be able to say "Get me the repository that can save this type". What patterns are there that can be used to do this? Do I need to maintain my own lookup table? can a lookup table be maintained automatically somehow?