代码生成器与 ORM 与存储过程 [英] Code generators vs. ORMs vs. Stored Procedures

查看:32
本文介绍了代码生成器与 ORM 与存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些软件架构分别在哪些领域大放异彩?

In what domains do each of these software architectures shine or fail?

哪些关键要求会促使您选择其中之一?

Which key requirements would prompt you to choose one over the other?

请假设您有可以进行良好的面向对象代码以及良好的数据库开发的开发人员.

Please assume that you have developers available who can do good object oriented code as well as good database development.

另外,请避免圣战:) 这三种技术各有利弊,我感兴趣的是哪里最适合使用哪一种.

Also, please avoid holy wars :) all three technologies have pros and cons, I'm interested in where is most appropriate to use which.

推荐答案

这些工具中的每一个都提供了不同的抽象层,以及覆盖行为的不同点.这些是架构选择,所有架构选择都取决于技术、控制和组织之间的权衡,包括应用程序本身和将要部署的环境.

Every one of these tools provides differing layers of abstraction, along with differing points to override behavior. These are architecture choices, and all architectural choices depend on trade-offs between technology, control, and organization, both of the application itself and the environment where it will be deployed.

  • 如果您正在处理一种 DBA统治"的文化,那么基于存储过程的架构将更容易部署.另一方面,管理和版本存储过程可能非常困难.

  • If you're dealing with a culture where DBAs 'rule the roost', then a stored-procedure-based architecture will be easier to deploy. On the other hand, it can be very difficult to manage and version stored procedures.

当您使用静态类型语言时,代码生成器会大放异彩,因为您可以在编译时而非运行时捕获错误.

Code generators shine when you use statically-typed languages, because you can catch errors at compile-time instead of at run-time.

ORM 是集成工具的理想选择,您可能需要在安装到安装的基础上处理不同的 RDBMS 和架构.更改一张地图,您的应用程序就会从在 Oracle 上使用 PeopleSoft 到在 SQL Server 上使用 Microsoft Dynamics.

ORMs are ideal for integration tools, where you may need to deal with different RDBMSes and schemas on an installation-to-installation basis. Change one map and your application goes from working with PeopleSoft on Oracle to working with Microsoft Dynamics on SQL Server.

我见过使用生成代码与存储过程交互的应用程序,因为可以调整存储过程以绕过代码生成器中的限制.

I've seen applications where Generated Code is used to interface with Stored Procedures, because the stored procedures could be tweaked to get around limitations in the code generator.

最终唯一正确的答案将取决于您尝试解决的问题以及解决方案需要执行的环境.其他任何事情都在争论'potato'的正确发音.

Ultimately the only correct answer will depend upon the problem you're trying to solve and the environment where the solution needs to execute. Anything else is arguing the correct pronunciation of 'potato'.

这篇关于代码生成器与 ORM 与存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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