资金计算,java和Oracle / PL SQL之间的比较使用 [英] Money computations, comparison between java and Oracle/PL SQL which to use

查看:196
本文介绍了资金计算,java和Oracle / PL SQL之间的比较使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理货币计算时,您可以根据自己的优势和劣势对Oracle / PL SQL和Java进行比较。
如果您要开发一个处理大量金钱计算的应用程序,您会使用哪两个?为什么?

Guys can you give a good comparison regarding Oracle/PL SQL and Java in terms of their strengths and weaknesses when handling monetary computations. If you were to develop an application which will be handling a lot of money computations which of the two would you use and why?

这个问题不是引发oracle / pl sql和java爱好者之间的争论我只是想知道这种要求的最佳实践或标准方法以及背后的原因。

This question is not to spark a debate between oracle/pl sql and java enthusiasts I just want to know what is considered the best practice or standard approach for this kind of requirement and the reason behind.

场景将是:


  1. 数据来自数据库(最低Oracle 10g)。

  2. 程序将根据汇总数据(100k-1M)记录计算和生成发票

  3. 业务规则非常复杂

  4. 业务规则可能至少更改一次一个月

  5. 计算中将使用几个参考表

  6. 程序将每天运行一次

  1. Data would be from the database (Oracle 10g minimum).
  2. The program would compute and generate invoices based on aggregated data (100k-1M) records
  3. Business rules are very complex
  4. Business rules may change at least once a month
  5. Several reference tables will be used in the computation
  6. Program will be ran once a day

提前致谢。

推荐答案

这些标准肯定有利于使用PL / SQL。

These criteria definitely favour the use of PL/SQL.


1)数据来自数据库(最低Oracle 10g)。

2)程序将计算和基于聚合的
数据(100k-1M)记录生成发票

5)计算中将使用几个参考表

6)程序将每天运行一次

1) Data would be from the database (Oracle 10g minimum).
2) The program would compute and generate invoices based on aggregated data (100k-1M) records
5) Several reference tables will be used in the computation
6) Program will be ran once a day

如果它在数据库中并涉及数据,尤其是大量数据,则PL / SQL是默认选项。

If it's in the database and involves data, especially lots of data, then PL/SQL is the default option.

其余标准评估起来比较棘手:

The remaining criteria are trickier to evaluate:


3)业务规则是非常复杂

4)业务规则可能每月至少更改

3) Business rules are very complex
4) Business rules may change at least once a month

PL / SQL绝对有能力进行计算,它有很多内置的算术功能。因此,它归结为业务规则和复杂的含义。我们可以在PL / SQL中编写复杂的业务逻辑(我已经完成了)但Java具有语言功能,这无疑使任务变得更容易:我正在思考像反射和内省这样的东西。

PL/SQL is definitely capable of undertaking computation, and it has lots of built-in arithmetic functions. So it comes down to exactly what you mean by "business rules" and "complex". We can code complex business logic in PL/SQL (I have done it) but Java has language features which undoubtedly make the task easier: I'm thinking of stuff like reflection and introspection.

也许您正在考虑使用规则引擎?当然,金融服务业一直是规则引擎的主要用户。并且从处理中抽象出规则集将使得更容易满足第四标准。

Perhaps you are thinking about using a Rule Engine? Certainly, the financial services sector has been a major user of Rule Engines. And abstracting the rule sets from the processing would make it easier to satisfy the fourth criterion.

Java有两个已建立的规则引擎, Drools和JESS 。那里的 PL / SQL中的规则引擎,已经有一段时间了,但它主要用作Oracle Streams的一部分。但是,API已暴露,因此可用于其他目的。 了解更多信息

Java has two established Rule Engines, Drools and JESS. There is a Rule Engine in PL/SQL, and has been for some time, but it is mainly used as part of Oracle Streams. However, the API is exposed so it could be used for other purposes. Find out more.

如果您正在考虑规则引擎,那么我认为这会向Java倾斜。业务规则处理是一种专业的编程范例,Java中的经验和支持比PL / SQL更多。我怀疑这意味着在中间层而不是Java存储过程中使用Java,这对网络流量和性能有影响。

If you're thinking about Rule Engines then I think that tips the hand towards Java. Business Rules Processing is a specialist programming paradigm, and there is simply more experience and support for it in Java than PL/SQL. I suspect that means going for Java in the middle tier rather than Java Stored Procedures, which has implications for network traffic and performance.

这篇关于资金计算,java和Oracle / PL SQL之间的比较使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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