哪个更重要? DB设计还是编码? [英] Which is more important? DB design or coding?

查看:125
本文介绍了哪个更重要? DB设计还是编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪个更重要:数据库的设计?或者应用程序代码的设计?



有很多关于可重用代码的信息(来自Carl Franklin,在 dnrtv.com CSLA.net ,et。al。) ,但我没有看到太多关于数据库设计的信息及其对应用程序生命的影响(尤其是早期的设计决策会影响应用程序后期的生命)。



很简单,你的代码取决于你的数据库,而不是数据库取决于你的代码。 (如果不是这样,您可能需要重新思考您的设计。)



解决您的编辑问题;我认为很多人对这种类型的问题写作/博客往往从事物的编码方面强烈地来,这些类型的人倾向于认为数据库设计是微不足道的,比编码有趣的解决方案有趣。基本上,对于喜欢解决棘手问题(这往往是博客的人更多)的人,编码方面比基本的设计问题更有趣。虽然基本的设计问题不是性感,但它们是非常重要的(数据库设计是一个非常基本的设计问题)。


Which is more important: The design of the database? Or the design of the application code?

There is a lot of information out there about reusable code (from Carl Franklin at dnrtv.com, CSLA.net, et. al.), but I don't see too much information about Database Design and its impact on the life of an application (particularly how bad design decisions early on affect the application later in its 'life'.

解决方案

Generally, Database structure is more important, since it provides the structural framework on which your code is developed. In general (and YMMV quite considerably), refactoring your DB structure after completing a phase of development is significantly harder than simply refactoring code which depends on a stable database. The reason is simple; refactoring your DB structure usually forces code changes; the reverse is rarely true.

Quite simply, your code depends on your database more than your database depends on your code. (If this is not the case, you may need to rethink your design.)

To address your edit; I think a lot of folks writing / blogging about this type of issue tend to come quite strongly from the "coding" side of things, these types of folks tend to consider database design to be trivial, and less interesting than coding interesting solutions. Essentially, to someone who likes to solve "tricky problems" (which tends to be the people who blog more), the coding side is more interesting than the fundamental design issues. And while the fundamental design issues aren't "sexy", they're extremely important (and Database Design is a VERY fundamental design issue).

这篇关于哪个更重要? DB设计还是编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆