New answers tagged

1

Yes, it is not good to put externally dependent logic in ORM classes. Ideally, an ORM's sole purpose is to provide a map from the database to the objects used by the code (ie- Object Relational Mapping) When you muddy the responsibility of an object's purpose you're breaking the ability to swap out components from the system without breaking the other ...


3

I think you are correct in your concerns. In both cases I would separate the repository functions from the object. The document object seems particularly bad in that the logic takes place in the constructor ie IDocumentRepository.Save(Document doc); IDocumentRepository.Search(string description) This helps you achieve a number of things: 1: No ...



Top 50 recent answers are included