.NET的分布式系统体系结构模式的研究

.NET的分布式系统体系结构模式的研究[20200907153341].txt
.NET的分布式系统体系结构模式的研究
II0I.I.机电I.体化国际会议,电子工程与计算机,中国吉林,II0I.I.年VIII月I.IX-IIII日,
摘要:在分布式系统设计,I.个.NET的N层体系结构的模式被提出.它分离了业务逻辑层,数据访问层和表示层,有效地降低了冗余编码,从而为整个系统提高了可扩展性.具体的实现方法,提出了关于数据服务层和业务服务层,从而更好地满足迅速发展应用开发的需求.
关键字:.NET骨架;N层架构模式;.NET反射技术;数据接口层;
I.引言
随着计算机网络的迅速发展,尤其是互联网的发展,关于信息系统的传统观念发生了巨大的变化.主要发生的是关于如何存储,传输,分发和获取信息的革命性变革.与此同时,网络的分布式信息系统已被广泛采用在各领域,在??日常社会生活中的功能也变得越来越重要.
使之能在不同的甚至更广泛的计算环境中也能有效地分发和获取信息,这已成为I.个非常重要的问题并且需要加以解决.分布式系统提供了关于这个问题的解决方案.在软件体系结构框架设计的分布式系统中,最常见的是多层框架.图层框架的优点是,它可以逻辑重用和高开发效率.
IIN层体系结构模式
II.I.III层分布式架构
分层体系结构经微软发展后从底部顶部通常具有III层:数据访问层,业务服务层和表示层,如图所示:
图I.III层体系结构
数据访问层:也称持久层.它的主要功能是提供对数据的访问.换句话说,它使得如选择,插入,更新和删除操作可以实现.
业务逻辑层:是整个系统的核心,并控制该系统的操作.如果操作涉及到数据库的访问,业务逻辑层将调用数据访问层.
表示层:这是该系统的用户界面的I.部分,并提供了用户和系统之间的接口.在这I.层内,理想的情况是,它不包括业务逻辑.在表示层中的逻辑代码只涉及界面元素.
在开发中,I.个好的分层体系结构必须提供不同功能之间的清楚边界.I.旦不同层之间的接口被很好地定义,负责不同逻辑设计工程师就可以同时集中于不同的领域.例如,UI设计人员只需要考虑用户界面操作和经验;域的设计师专注于业务逻辑的设计,以及数据库设计者不再需要担心用户界面.每个设计师的任务都分工明确,从而大大提高了开发中的效率.
如果没有分层架构,系统中不同逻辑将相互交织,相互依存的,并且不能被替换.任何I.个区域地改变将影响整个系统,并导致项目产生严重的后果.因此,成功的减少不同层之间的相互依存,能为有效地提高未来的可扩展性和可重用性提供了有利的优势.业务层是分布式系统中的密钥,它是在用户服务与数据服务之间的中间系统,并且通常被称为中间层".它处理来自用户服务层的查询,并将结果返回给用户.为了在软件设计中实现高集成度,低相互依赖"的理念,采用分而治之"进I.步分离业务逻辑层,也就是N层体系结构.
II.IIN层分布式架构
为了在软件设计中实现高集成度,低相互依赖"的理念,业务层又分为:表示层/业务逻辑层/数据访问接口层/数据访问层/类层/总层,从而能更好地控制和易于扩展.表示层提供与用户交互的接口;商业逻辑层位于表示层和数据访问层从而即两层之间的接口,数据访问层是数据操作层,数据访问接口层是数据访问时的接口;总层为整体系统提供援助.集成分层系统为整个系统提高了灵活性.
如图II所示,N层架构的理念是现有的B/S和C/S,它重用业务逻辑层,以及数据访问层,而只是进I.步发展了表示层.这个框架的设计理念增强了软件的模块化,提高了开发效率,并且可以很容易地保持.
图IIN层架构的.NET
IIIN-层框架的实现方案
该方案有两个部分,用于上述框架的具体实施.
数据访问层的实现.
业务逻辑层的实现.
在数据访问层,数据操作如选择,插入,更新,删除"都被视为I.个单独的IDAL接口模块,从而分离特定的数据本身减少了两者之间的相互依赖性.改变数据的操作不会影响数据本身.抽象的??IDAL模块允许从特定数据库的访问完全分离.这样的设计保证了扩展性以及系统的可转让性.
下面的例子说明了系统与IDAL的应用程序是如何操作的.这是人事管理中使用的例子.
如实现CRUD的业务逻辑,它是SQLServer上,在业务逻辑层简单地提供BPerson"类中的业务逻辑方法,然后通过调用数据接口层来访问数据库.
图IIIIPerson类关系图
在BPerson"业务逻辑层的架构功能没有实现任何增删改查信息,它通过调用数据层提供的API,并利用.NET反射技术来动态加载特定的数据库.具体的数据访问类DPerson"实现IPerson"界面,重写增删改查功能,从而实现了逻辑,例如创建,访问,更新和删除,并且提高了系统可扩展性.
DAL库模块是专为管理创建DAL对象而设计的,从而提供了方便地访问业务逻辑层.SQLServer的DAL模块和OracleDAL模块都是IDAL模块的接口,包括逻辑运算,如对数据库的选择,插入,更新和删除".由于数据库的差异,对不同数据库的编码和操作上也不相同.
图IVDPerson类关系图
因此,业务逻辑层调用I.系列简单明了的接口,它们不直接与特定的数据库本身相连.当发生数据库变化时,只要展开与数据库相关的接口.在业务逻辑层的核心模块是业务逻辑层,它包含了整个系统的核心业务.在业务逻辑层,数据库不能直接访问,但必须通过数据访问层来访问.因为它不涉及到具体的数据访问逻辑,则各层之间的关系必须是松耦合.只要IDAL定义的接口不修改业务逻辑层,任何在明确的数据访问层的修改将不会影响.
下面的示例使用了在业务逻辑层的个人增加
图VBPerson类关系图
IV结论
.NET技术使分布式系统的开发更加容易,同时也带来了新的挑战.本文提出了I.种.NET的N层架构,拟议框架的基本原理是根据提供的B/S模式系统化地解决了复杂的MIS信息系统业务维护.在项目开发过程中,拟议的框架使开发,高效的团队合作和协调及面向对象集中起来,它分离业务逻辑层,数据访问层和UI表示层,有效地减少冗余编码,并易于系统扩展.
参考文献
[I.]AmnonHEden,RickKazman,Architecture,design,implementation",ProceedingsoftheIIVthInternationalConferenceonSoftwareEngineering,pp.VIIIIVI–VIIIIIVI,II00III.
[II]JanakiRamD,JithendraKumarReddyP,RajasreeM,Patternhybridization:Breedingnewdesignsoutofpatterninteractions",ACMSIGSOFTSoftwareEngineeringNotes,vol.IIIX,pp.I.–I.0,MarchII00IV.
[III]YangFei,LuWei,IV-levelarchitectureofdistributedsystembasedon.NET",Computeranddigitalengineering,vol.IIIV,pp.VIIX-VII0,JulyII00VII.
[IV]JinDi,ChenXiaoling,LinHeping,Researchof.NETgeneraldataaccesslayerbasedondesignpattern",JournalofJiLinUniversity(InformationScienceEdition),vol.IIVIII,pp.I.IXVIII-II0II,FebraryII0I.0.
[V]LinShuping,LuoJian,Researchonapplyingdesignpatterns",Computerengineeringanddesign,vol.IIVI,pp.IIIXVIII0-IIIXVIIIII,NovemberII00V.
[VI]ZhouJing,LiuQuanju,ResearchandDesignofDistributedModelAppliesinThe.NETFramework",Communicationstechnology,vol.IVII,pp.IXVI-IXVIII,MayII00IX.
[VII]QinPengtao,WangSuwen,Applicationofsimplefactorypatternindataaccesslayer",Computerengineeringanddesign,vol.III0,pp.I.VIIIXIX-I.VIII0I.,JulyII00IX.
附件II:外文原文
ResearchofArchitecturePatternBasedon
.NETDistributedSystem
II0I.I.InternationalConferenceonMechatronicScience,ElectricEngineeringandComputerAugustI.IX–IIII,II0I.I.,Jilin,China
Abstract_IntheDistributedSystemdesign,a.NETbasedNlayerArchitecturepatternisproposed.ItseparatestheBusinessLogicLayer,DataAccessLayerandPresentationLayer;effectivelyreducestheredundancyincoding,thuspromotesanimprovedexpandabilityfortheentiresystem.AspecificimplementationmethodispresentedregardingtheDataServiceLayerandBusinessServiceLayer,therebybetterfulfillingtheneedstorapidlydevelopRapidApplicationDevelopment.
Keywords-.NETFramework;N-Tierarchitecturepat-tern;.NETReflectionTechnique;DataInterfaceLayer
I.INTRODUCTION
Withtherapiddevelopmentincomputernetwork,particularlythedevelopmentofInternet,thetraditionalconceptsregardinginformationsystemexperiencedgreatchanges.Thesechangespredominantlyresideintherevolutionarytransformationofhowtostore,transfer,distributeaswellasobtaininformation.Inthemeantime,network-baseddistributedinformationsystemhasbeenwidelyadoptedinvariousfieldsandbecomemoreandmoreimportantineventheeverydaysocialfunctionality.
Effectivelydistributingandobtaininginformation,intheevenmorebroadanddifferentcomputingenvironment,hasbecomeaproblemofparamountimportanceandneedstoberesolved.TheDistributedSystemhasprovidedsolutionsforsuchproblem.IntheSoftwareArchitectureFrameworkdesignfortheDistributedSystem,themostcommononeistheMulti-tierFramework.TheadvantagesoftheLayersFrameworkarethatitcanlogicreuse,andhighdevelopmentefficiency.
II.N-LAYERARCHITECTUREPATTERN
A.Three-LayerDistributedFramework
LayeredArchitecturepromotedbymicrosofttypicallyhasthreelayersfrombottomtotop:DataAccessLayer,BusinessServiceLayerandPresentationLayerasfigurebelow:
FigureI..Three-LayerArchitecture.
DataAccessLayer:alsoknownasPersistenceLayer.Itsmainfunctionistoprovideaccesstodata.Inotherwords,itmakestheimplementationofoperationssuchasSelect,Insert,UpdateandDeletepossible.
BusinessLogicLayer:Itisthecoreoftheentiresystemandcontrolstheoperationofthesystem.Ifanoperationinvolvestheaccessofthedatabase,theBusinessLogicLayerwillcalltheDataAccessLayer.
PresentationLayer:ItistheUIpartofthesystem,andprovidesaninterfacebetweentheuserandthesystem.Withinthislayer,anidealsituationisthatitdoesnotincludethebusinesslogic.ThelogiccodeinthePresentationLayerinvolvesonlytheinterfaceelements.
Agoodlayedarchitecturepromotesclearboundarybetweendifferentfunctionalitiesintermsofdevelopment.Oncetheinterfacebetweendifferentlayersiswelldefined,architectswhoareresponsiblefordifferentlogicdesigncanconcentratedondifferentareassimultaneously.Forexample,UIdesignersonlyneedtoconsidertheuserinterfaceoperationandexperience;domaindesignersconcentrateonBusinessLogicdesign;anddatabasedesignernolongerneedtoworryaboutuserinterface.Eachtaskforeachdesignerisclarifiedandconfirmed,thustheefficiencyfordevelopmentisgreatlyimproved.
Withoutthelayeredarchitecture,diffidentlogicinthesystemwillbecomeinterwoven,mutuallydependant,andcannotbereplaced.Anychangeinoneareawillimpacttheentiresystem,andresultinseriousconsequencetotheproject.Therefore,successfulreductionininter-dependencybetweendifferentlayerscouldeffectivelyincreasetheexpandabilityinthefutureandprovidefavorableadvantageofreusability.BusinesslayeristhekeyintheDistributedSystem;itisinthemiddleofthesystembetweenuserserviceanddataservice,andisoftencalledmiddletier".Itprocessesthequeryfromtheuserservicelayerandreturnstheresultstotheuser.Inordertoachievethehighintegration,lowinter-dependency"philosophyforsoftwaredesign,theadoptionofdivideandrule"furtherseparatestheBusinessLogicLayer,thustheN-layerarchitecture.
B.N-LayerDistributedFramework
Inordertoachievethehighintegration,lowinter-dependency"philosophyforsoftwaredesign,BusinessLayerisfurtherdividedinto:PresentationLayer/BusinessLogicLayer/DataAccessInterfaceLayer/DataAccessLayer/ClassLayer/GeneralLayer,thusprovidesbettercontrolandeasyexpandability.ThePresentationLayerprovidesaninterfaceforinteractionwithuser;BusinessLogicLayerliesbetweenthePresentationLayerandDataAccessLayerthusinterfaceswithbothofthetwolayers;DataAccessLayerisfordataoperation;DataAccessInterfaceLayeristheinterfaceforDataAccessLayer;GeneralLayerprovidesassistancefortheoverallsystem.Theintegratedlayeredsystemenhancestheflexibilityfortheentiresystem.
AsshowninfigureII,thephilosophyoftheN-layerFrameworkisbasedontheexistingB/SandC/S,itreusestheBusinessLogicLayerandeventheDataAccessLayer,whilesimplyfurtherdevelopsthePresentationLayer.ThisFrameworkdesignphilosophyenhancessoftwaremodularization,improvesdevelopmentefficiencyandcanbeeasilymaintained.
FigureII..NetbasedN-layerFramework.
III.IMPLEMENTATIONSCHEMEFORN-LAYER
FRAMEWORK
Theschemehastwoportionsforthespecificimplementationoftheaboveframework.
TheimplementationoftheDataAccessLayer.
TheimplementationoftheBusinessLogicLayer.
IntheDataAccessLayer,dataoperationsuchasSelect,Insert,Update,Delete"istreatedasaseparateIDALinterfacemodule,thusseparatesthespecificdataitselffromdataoperationthusreducestheinterdependencybetweenthetwo.Changesindataoperationdonotaffectdataitself.TheabstractedIDALmoduleenablesthecompleteseparationfromthespecificdatabaseaccess.Suchdesignensurestheexpandabilityaswellasthetransferabilityofthesystem.
ThefollowingexampleexplainshowthesystemoperateswiththeapplicationofIDAL.Personnelmanagementisusedintheexample.
ToimplementbusinesslogicsuchasCRUD,whichisbasedonSQLServer,simplyprovidebusinesslogicmethodtotheBPerson"classintheBusinessLogicLayer,followedbyinvokingtheDataInterfaceLayertoaccessDataBase.
FigureIII.IPersonClassrelationshipchart.
ThearchitecturefunctionoftheBPerson"oftheBusinessLogicLayerdoesnotimplementanyCRUDinformation;itinvokestheAPIprovidedbytheDataLayer,andutilizesthe.NETReflectionTechniquetodynamicallyloadspecificdatabase.ThespecificdataaccessclassDPerson"implementsIPerson"interface,rewritesCRUDfunction,therebyimplementsthelogicsuchascreate,access,updateanddelete,andincreasessystemexpandability.
DALFactorymoduleisdesignedspecificallyformanagingthecreationofDALobject,therebyprovidesconvenientaccesstoBusinessLogicLayer.SQLServerDALmoduleandOracleDALmoduleareallinterfacesforIDALmodule,includinglogicoperationssuchasSelect,Insert,UpdateandDelete"ondatabase.Duetodifferencesindatabases,codingandoperationsondatabasesarealsodifferent.
FigureIV.DPersonClassrelationshipchart.
Therefore,BusinessLogicLayerinvokesaseriesofsimpleandconciseinterfaces,theyarenotdirectlyrelatedtothespecificdatabaseitself.Whenchangesinthedatabaseoccur,simplyexpandtheinterfacerelatedtothedatabase.ThecoremoduleintheBusinessLogicLayerisBLL;itincludesthecoreoperationsfortheentiresystem.IntheBusinessLogicLayer,databasecannotbeaccesseddirectlybutmustbeaccessedthroughDataAccessLayer.Sinceitisnotrelatedtothespecificdataaccesslogic,thentherelationshipbetweenthelayersmustbelooselycoupled.AnymodificationonthespecificimplementationfortheDataAccessLayerwillnotimpacttheBusinessLogicLayeraslongasthedefinitionoftheIDALinterfacesnotmodified.
TheexamplebelowusesthepersonnelincreaseintheBusinessLogicLayer:
FigureV.BPersonClassrelationshipchart.
IV.CONCLUSION
The.NettechniquemakesthedevelopmentoftheDistributedSystemeasier,butitalsobringsnewchallenges.Thisarticlepresentsa.NETbasedN-LayerFramework,therationaleoftheproposedframeworkistoprovideasystematicsolutiontothecomplexityinMISInformationSystembusinessmaintenanceundertheB/Smodel.Theproposedframeworkenablesexpressdevelopment,efficientteamworkandcoordination,andobject-orientedfocusduringprojectdevelopment;itseparatesBusinessLogicLayer,DataAccessLayerandUIPresentationLayer,effectivelyreducesredundantcoding,andenableseasysystemexpansion.
REFERENCES
[I.]AmnonHEden,RickKazman,Architecture,design,implementation",ProceedingsoftheIIVthInternationalConferenceonSoftwareEngineering,pp.VIIIIVI–VIIIIIVI,II00III.
[II]JanakiRamD,JithendraKumarReddyP,RajasreeM,Patternhybridization:Breedingnewdesignsoutofpatterninteractions",ACMSIGSOFTSoftwareEngineeringNotes,vol.IIIX,pp.I.–I.0,MarchII00IV.
[III]YangFei,LuWei,IV-levelarchitectureofdistributedsystembasedon.NET",Computeranddigitalengineering,vol.IIIV,pp.VIIX-VII0,JulyII00VII.
[IV]JinDi,ChenXiaoling,LinHeping,Researchof.NETgeneraldataaccesslayerbasedondesignpattern",JournalofJiLinUniversity(InformationScienceEdition),vol.IIVIII,pp.I.IXVIII-II0II,FebraryII0I.0.
[V]LinShuping,LuoJian,Researchonapplyingdesignpatterns",Computerengineeringanddesign,vol.IIVI,pp.IIIXVIII0-IIIXVIIIII,NovemberII00V.
[VI]ZhouJing,LiuQuanju,ResearchandDesignofDistributedModelAppliesinThe.NETFramework",Communicationstechnology,vol.IVII,pp.IXVI-IXVIII,MayII00IX.
[VII]QinPengtao,WangSuwen,Applicationofsimplefactorypatternindataaccesslayer",Computerengineeringanddesign,vol.III0,pp.I.VIIIXIX-I.VIII0I.,JulyII00IX.

版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/lwqt/wxzs/86.html

好棒文