New answers tagged orm
The one solution I have come up with is to create "View" Models. I create simple versions of the database models that do not include the reference to the parent class. These view models each have method to return the Database Version and a constructor that takes the database model as a parameter (viewmodel.name = databasemodel.name). This method ...
I am not an expert on this subject, but will try an answer. According to this article the Repository pattern is specifically designed to solve your problem. So in my understanding you should have one repository that will return the concrete or abstract Animal required.
One reason can be that a direct reference to an object provides a snapshot of it as it was at a moment in time. When you hold only a reference to the identity, you might then be forced to grab a fresh copy of the object. And the lack of pointers to objects will allow for more efficient garbage collection. Consider what an identity map does. It provides a ...
Top 50 recent answers are included