我需要知道将业务层保留在程序中的缺点
在我的工作中,我有一个朋友坚持使用存储过程将业务逻辑保留在数据库中......
我可以用什么论据来说服他不要做这样的事情?
他想要这样做的原因是因为我们有多个具有不同平台的系统(.NET 中的 Web 应用程序和 VB.NET 以及另一个在 Power Builder 中开发的桌面应用程序 - Sybase)。
谢谢!
In my work, i have a friend that insists to keep the business logic inside the database using stored procedures ...
What are the arguments that i can use to convince him not to do such thing?
The reason he want to do this is because we have multiple systems with diferent plataforms (Web Application in .NET with VB.NET and another Desktop Application developed in Power Builder - Sybase).
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你反对的理由是什么?为什么您一定要远离存储过程?
这实际上并不是一个坏主意。如果您有用不同语言编写的不同系统访问数据库,那么将至少部分业务逻辑保留在数据库中可能会有所帮助。
What are your arguments against it? Why do you necessarily want to stay away from stored procedures?
This is actually not a bad idea. If you have different systems written in different languages access the database, it may help to keep at least some of the business logic in the database.
我选择 Web 服务有几个原因:
I would go for the web service for several reasons:
专业的网络服务,反对数据库逻辑:
专业的数据库逻辑,反对网络服务:
不要屈服于教条。考虑两者的优缺点,并根据您的应用程序的具体情况做出理性的决定。听起来你和你的同事都做出了非黑即白的情感决定。请记住:结果并不反映你作为一个人。当它投入生产后,你会发现它对你作为设计师的影响。
Pro web services, con database logic:
Pro database logic, con web services:
Don't give in to dogma. Consider the pros and cons of both and make a rational decision based on your app's particular situation. Both you and your co-worker sound like you've make it a black or white emotional decision. Remember: the outcome doesn't reflect on you as a person. You'll find out about what it says about you as a designer after it's in production.
定义业务逻辑
无论如何,您只需使用数据库来完成它所要做的事情做得最好。诸如聚合和数据完整性之类的东西。
但每个系统都是一种妥协。如果您有 5 组不同的客户端,那么数据库可能是最好的地方。并非每个电子表格或 Access DB 都可以调用漂亮的中间层 Web 服务...
Define business logic
Anyway, you simply use the DB to do what it does best. Stuff like aggregation and data integrity.
But every system is a compromise. If you have 5 different sets of clients, then the DB might be the best place. Not every spreadsheet or Access DB can call your beautiful middle tier web services...