Get(int id); public IList<T> GetAll(); } public class GetObjectService<T> : IGetObjectService<T> { public GetObjectService(IRepository<T> repository) { } public T Get(int id) { ... } public IList<T> GetAll() { ... } }
... } public bool Save() { ... } public bool Delete() { ... } } How do I stub out the Load method in a test? How can I implement cross-cutting concerns (e.g. caching when saving) without duplicating code?
Brian Eng Agile Web Development With Rails by Sam Ruby, Dave Thomas, David Heinemeier Hansson Programming Ruby 1.9 (aka the “Pickaxe” book) by Dave Thomas, with Chad Fowler and Andy Hunt All found at http://pragprog.com