zoukankan      html  css  js  c++  java
  • easy-rules 4.0 发布了

    easy-rules 4.0 发布了,基于java8 开发,有好多api 上的变动,以下是一个简单的说明

    新特性

    • 添加一个新的领域对象Fact 替换以前的Map<String,Object>
    • Facts 添加了clear 方法
    • 添加了BeanResovler 到SpELAction 以及SpELCondition
    • MVAEL&& Spel 条件如果出现问题,将直接跑出异常(方便调试)
    • Spel 条件以及action使用#{...} 这个早期版本很不规范问题比较多

    移动的api

    • RulesEngineParameters has been moved from package org.jeasy.rules.core to org.jeasy.rules.api
    • CompositeRule and its implementations (ActivationRuleGroup, UnitRuleGroup and ConditionalRuleGroup) have been moved from the root package org.jeasy.rules.support to a dedicated package org.jeasy.rules.support.composite
    • RuleDefinitionReader and its implementations (AbstractRuleDefinitionReader, YamlRuleDefintionReader and JsonRuleDefintionReader) have been moved from the root package org.jeasy.rules.support to a dedicated packageorg.jeasy.rules.support.readerzabbix-server-mysql |

    删除的api

    对于MVEL以及SpEL模块,ParserContext 传到rules 以及rule factories 在构造函数阶段

    • Methods org.jeasy.rules.mvel.MVELRule.when(String, ParserContext) and org.jeasy.rules.mvel.MVELRule.then(String, ParserContext)
    • Methods org.jeasy.rules.mvel.MVELRuleFactory.createRule(Reader, ParserContext) and org.jeasy.rules.mvel.MVELRuleFactory.createRules(Reader, ParserContext)
    • Methods org.jeasy.rules.spel.SpELRule.when(String, ParserContext) and org.jeasy.rules.spel.SpELRule.then(String, ParserContext)
    • Methods org.jeasy.rules.spel.SpELRuleFactory.createRule(Reader, ParserContext) and org.jeasy.rules.spel.SpELRuleFactory.createRules(Reader, ParserContext)
    • Methods org.jeasy.rules.support.AbstractRuleFactory.createSimpleRule(RuleDefinition, ParserContext) and org.jeasy.rules.support.AbstractRuleFactory.createCompositeRule(RuleDefinition, ParserContext) do not take a ParserContext as parameter anymore.

    修改的api

    因为提供了Fact 领域类型,所有有以下变动

    • Facts#put(String, Object) does not return the previous associated value if any, the return type is now void
    • Facts#remove(String) does not return the removed fact anymore, the return type is now void
    • Facts#iterator now returns a Iterato

    说明

    后边顺便把以前包装的一个spring boot starter 也升级调整了,4.0 的好多特性还是很不错的

    参考资料

    https://github.com/j-easy/easy-rules/releases

  • 相关阅读:
    Java实现 LeetCode 189 旋转数组
    Java实现 蓝桥杯 算式最大值
    Java实现 蓝桥杯 算式最大值
    Java实现 蓝桥杯 算式最大值
    Java实现 神犇的悲惨一生
    编译Boost 详细步骤 适用 VC6 VS2003 VS2005 VS2008 VS2010
    boost:asio编译
    VS2008下编译BOOST 1.39的ASIO库
    Boost下载安装编译配置使用指南
    Boost下载安装编译配置使用指南(含Windows和Linux
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/12985800.html
Copyright © 2011-2022 走看看