《软件体系结构》课件 05-虚拟机体系结构风格_第1页
《软件体系结构》课件 05-虚拟机体系结构风格_第2页
《软件体系结构》课件 05-虚拟机体系结构风格_第3页
《软件体系结构》课件 05-虚拟机体系结构风格_第4页
《软件体系结构》课件 05-虚拟机体系结构风格_第5页
已阅读5页,还剩20页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

软件体系结构—虚拟机风格软件体系结构课程组本节内容虚拟机风格1解释器风格22规则引擎34课程总结虚拟机风格Interpreters(解释器)SimulatefunctionalitywhichisnotnativetothehardwareRule-basedsystems(规则系统)SpecializationofaninterpreterOtherSyntacticshellsCommandlanguageprocessors解释器风格Problem:

Thispatternissuitableforapplicationsinwhichthemostappropriatelanguageormachineforexecutingthesolutionisnotdirectlyavailable.Thepatternisalsosuitableforapplicationsinwhichthecoreproblemisdefininganotationforexpressingsolutions,forexampleasscripts.Interpretersaresometimesusedinchains,translatingfromthedesiredlanguage/machinetoanavailablelanguage/machineinaseriesofstages.Context:

Theinterpreterwillmostoftenbedesignedtobridgethegapbetweenthedesiredmachineorlanguageandsome(possiblyvirtual)machineorlanguagealreadysupportedbytheexecutionenvironment.解释器风格Solution:Systemmodel:virtualmachineComponents:onestatemachine(theexecutionengine)andthreememories(currentstateofexecutionengine,programbeinginterpreted,currentstateofprogrambeinginterpreted)Connectors:dataaccessandprocedurecallControlstructure:usuallystate-transitionforexecutionengine;inputdrivenforselectionofwhattointerpretSignificantVariants:Expertsystemsareoftenimplementedasinterpretersforthecollectionsofrules,orproductions,thatrepresenttheexpertise.Becausetheproductionsrequireacomplexselectionrule,specializedformsofinterpretershaveevolved.解释器风格解释器风格:优势Functionality:Cansimulatenon-nativefunctionalityTesting:Cansimulate“disaster”modes(e.g.forsafety-criticalapplications)Flexibility:Verygeneral-purposetool解释器风格:劣势Efficiency:Much,muchslowerthanhardwareMuchslowerthancompiledsystemTesting:Additionallayerofsoftwaretobeverified解释器风格:用途解释型语言VB、Javascript、VBScript、HTML、Java字节码、Matlab脚本、配置文件通信协议用户输入游戏中的组合按键规则系统风格规则系统特征Codetobeexecuted(knowledgebase)Interpretationengine(ruleinterpreter)Controlstateofinterpreter(rule/dataselection)Currentstateofthecode(workingmemory)复杂规则系统示例规则系统的抽象黑板系统与规则系统的相似性一个实际的规则引擎:DroolsDrools是Redhat公司JBoss业务逻辑智能模块/drools/Drools是处理规则的专家系统一个实际的规则引擎:Drools声明式编程规则引擎允许你说“做什么”,而不是“怎样去做”规则系统能解决非常困难的难题逻辑和数据分离快捷和灵活知识集中化工具集成良好的解释机制易于理解的规则一个例子产生背景系统庞大,业务复杂业务规则经常改变24小时服务业务统一管理降低系统维护升级成本产生式规则引擎许多产品规则系统的大脑实际上就是一个推理引擎,用于匹配事实(Fact)和规则(Rule)当匹配被找到,规则对应的动作(Action)会被触发(Fire)动作经常会改变事实的状态,或者在应用上执行一些“外部”动作RETE网络节点简单的RETE网络Drools体系结构Drools体系结构与经典的规则引擎对比虚拟机风格总结Interpreters(解释器)Simulatefunctionalitywhichisnotnativetotheha

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论