This question is about ‘best use’ scenarios in projects with ORMs like NHibernate, Subsonic, Linq2SQL, etc…
All of these tools generate basic entity classes, some with attributes, others without. Do people use these classes as their business classes? Or is there wholesale copying of data from ORM generated classes to manually created business classes?
Thanks.
I tend to work the opposite way. I create the business objects the way I need them, and create NHibernate mappings from my objects to data. You can have NHibernate generate a schema for you based on your mappings, or you can create your own schema, and create the mappings to go between the two. Linq2Sql and Entity Framework do not support this. I can’t speak to Subsonic on this point.
I usually create my business classes, and get the application at least partially running without any database at all. This way I can develop a better understanding of what it is the application is supposed to do, and how it should behave before making the decision of how to persist the objects.