Let us suppose we are going to start new project - application that contains some business logic, user interface on ASP.NET, WPF or both of them. We'd like to use ORM or DAL code generator and implement our business logic in .NET classes. There are several fundamental ways how we can express our ideas of business domain:
- Implement business classes on .NET and let ORM generate appropriate database schema
- Create database schema manually and generate .NET classes by code generator
- Use some kind of visual designer, that can generate business classes and database structure or script
What do you prefer to write: "Create Table Persons ( ... )" or "public class Person { ... }"?
What are Pros and Cons of those ways?
Maybe there are some special situations where one way is better than another?
How to choose optimal way in a particular project?
I am quite familiar with "Code-First" (or "Model-First") way, but it seems most of ORMs are designed as code generators or mappers, that suppose that I will manually implement both database structure and business classes.
Answers based on expirience and examples of ORM's are especially welcome.
Edit: Note, the question is not "What should I do first when starting new project?", but "What should be manually declared / automatically generated, domain classes or database structure?"