Code-First or Database-First, how to choose?

后端 未结 11 1295
盖世英雄少女心
盖世英雄少女心 2020-12-23 16:34

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 DA

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-23 17:18

    Analysis of requirements first, and then some documentation of those needs and an overview of the data aspects of this?

    Then you know what data you'll be capturing and how it relates to other data, and can design a database schema or data structure to match it (as logical objects/tables of related content, not "tab1_data", "tab2_data" matching the data capture process which could change, but you know that!). You could even design a .xsd first and generate code and a database schema from that. It's all fun and games these days, depending on your skillset.

    As the database schema in my mind stores the data, and that is the really important thing for a business to have, I would design that first - multiple tools may access it in time, maybe the original system would be replaced down the line (e.g., migration to newer tools/languages/interfaces). If you know nothing about database theory, then maybe that's not your best option but I would still get any generated schema verified by someone else.

提交回复
热议问题