This worked pretty good last time so i'm gonna try it again. We have a Repository base class (yes we still use it, and no, i'm not going to get into the discussion that's going on about in on other blogs) which uses NHibernate underneath. We have the typical Get method which retrieves an object based on an ID. This method uses NHibernate's ISession's Get method, which either returns the entity if it's present in the database, or it returns null.
Some people want to put an equivalent to NHibernate's ISession's Load method into the base repository class, but we just can't come up with a good name for it. In case you don't know, ISession.Load either returns the actual entity if it's already in the session cache, or it returns a proxy for the entity but it does not immediately hit the database. The functionality of the Load method is thus very different from the Get method. Now, i think this is a case of extremely bad naming within NHibernate, and i don't want to have the same naming issue in our Repository implementation.
So basically, the question is: how would you name the equivalent of the Load method? Remember: this method returns a proxy to an entity if it's not yet in the session cache, whereas the Get method actually retrieves the entity from the database immediately or returns null if the entity for the given ID does not exist.
Pingback: Arjan`s World » LINKBLOG for April 24, 2009