花痴流口水颜文字_流口水:传统方法的问题

花痴流口水颜文字

Drools is extensively used in the BFSI Industry(Banking, Financial services and Insurance). The primary reason being the continuously changing requirements and the addition of new rules which keeps on adding given the Volatility in the BFSI Industry.

DroolsBFSI行业 (银行,金融服务和保险)中得到广泛使用。 主要原因是不断变化的要求以及在BFSI行业波动的情况下不断增加的新规则。

Let us take an example of a system where trades are coming from external system in the form of XML and JAXB is used and casted into customized Java Object. Now there are business rules which needs to be applied on certain parameters in the xml.

让我们以一个系统的示例为例,其中交易来自XML形式的外部系统,并且使用JAXB并将其转换为自定义Java Object 。 现在,有一些业务规则需要应用于xml中的某些参数。

So the code would be something like:

因此,代码将类似于:

if (trade.getProductInformation() == Product.IRS) {
	// do something for IRS (Interest Rate Swap Trade)
} 
else if (trade.getProductInformation() == Product.CDS) {
  	if (trade.getPartyIds() == null) {
    	// do something else for CDS trades with no Party Id
  	} 
  	else {
    	if(trade.getTradeId() ! =null) {
			//do something
      }
  }
}

Now currrent java code handles two product type (IRS and CDS) and the application wants to onboard a third product(Bonds), the above Java code will be very difficult to maintain and change every time a new condition has to be introduced.

现在,当前的Java代码处理两种产品类型( IRSCDS ),并且应用程序希望使用第三种产品(债券) ,每次必须引入新条件时,上述Java代码将很难维护和更改。

The solution to the rescue is using a Rule Engine. With Rule Engine your business logic is segregated in Rules and if there is a new product to be on boarded, only new rules would have to be added.

救援的解决方案是使用Rule Engine 。 使用Rule Engine,您的业务逻辑将被隔离在Rule中,并且如果要使用新产品,则只需添加新规则。

For example:

例如:

if Trade( productInformation == Product.IRS)
	then do something else for IRS Trade

if Trade( productInformation == Product.CDS)
	then do something for CDS trade

Now a new system is added so a new rule would be:

现在添加了一个新系统,因此新规则将是:

if Trade( productInformation == Product.BONDS)
	then do something for BONDS trade

The above example is a simple one (just for reference). When there are a lot of nested if and else statements in the code then using rules really help in easily adding new requirements/changes to the application and also the modification of the existing rules.

上面的示例是一个简单的示例(仅供参考) 。 当代码中有很多嵌套的ifelse语句时,使用规则确实有助于轻松地向应用程序中添加新的需求/更改以及对现有规则的修改。

翻译自: https://www.studytonight.com/drools/problem-trad-approach

花痴流口水颜文字

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值