用户名: 密码: 验证码:
基于Castle框架组件机制的研究及其应用
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
伴随着软件开发技术的发展,在多层的软件开发项目中,可复用易扩展的,而且是经过良好测试的软件组件,越来越为开发者所青睐。这意味着开发人员可以将充裕的时间用在分析、构建业务逻辑的应用上,而非繁杂的代码编程上。于是开发人员将相同类型问题的解决途径进行抽象,抽取成一个应用框架。利用这些框架构建的分布式应用程序完美的实现了应用程序高内聚、低耦合、高弹性、易维护的优点。框架提供了大粒度软件复用的新途径,提高了软件开发的效率。因而如何设计并构建一个强健而稳定的框架一直是众多软件开发者致力研究的目标。
     当今两大主流开发平台是Microsoft公司的.NET平台和Sun公司的J2EE平台。.NET平台以开发效率高、简单易用有后起之优势,然而J2EE在开发框架方面却更成熟。对此,在微软开发阵营里也相继推出了一系列开源框架。其中Castle就是针对.NET平台开发的一个非常优秀的开源框架。该框架既保持了.NET平台下快速开发的优势,又加上了框架的思想,使整个系统的架构非常合理。
     Castle框架是.NET平台下的一个开源框架,它将一些成熟开源应用进行无缝整合,从而形成了一套完善的应用系统框架。Castle框架将会帮助开发人员用最少的时间和最优化的代码完成开发任务,简化了企业级开发和Web应用。
     本文主要研究Castle框架中两大核心机制-IOC机制和AOP机制。首先讨论了两种机制的发展历史及其在Castle框架中的表现形式;其次分别讨论了两种机制在系统应用上的好处和优势;在设计方面,为了简化开发人员今后在采用Castle框架中IOC和AOP机制设计系统的工作量,在本论文中,设计出了一个IOC和AOP配置文件自动生成的可视化工具,该工具为程序员快速完成应用系统中IOC和AOP配置文件提供了一个很好的平台。为了更好的测试该可视化工具同时为了体现IOC和AOP机制的好处,本人利用该可视化工具完成了无线网络资源管理系统中的基站管理模块的开发。这个MIS系统是基于Castle框架中IOC和AOP机制开发的。完成的基站管理模块除了实现一些增删改、查询这些基本操作外,还实现了日志记录、权限控制和事务服务。当然后者的实现是基于IOC和AOP机制的。
Along with development of the software technology, in multilayer software development project, more and more developers favor the software component which is easy to reuse and expand and which has been good tested. This means that the developers would be able to spend abundant time on analyzing and constructing business logic of an application rather than on complex programming code. Therefore the developers could abstract same type questions and extract an application framework. They can construct a distributional application program which perfectly realizes the merit of high cohesion, low coupling, strong flexibility and easy maintainability by using these frameworks. The framework has provided a new way for big granularity software reuse, which has raised software development efficiency. Thus, how to build a sturdy and stable framework is the aim of many software developers all the while.
     Nowadays, Microsoft Corporation's .NET platform and Sun Corporation's J2EE platform are two mainstream development platforms. .NET development platform has advantage of high efficiency and it is easy to use,however J2EE is especially prominent in the aspect of development framework. Regarding to this, Microsoft Corporation also brings out a series of open source frameworks one after another. Castle is an excellent open source framework under the .NET platform. Not only this framework maintains .NET platform's superiority of fast development, but also makes the overall system construction trend to be reasonable.
     Castle is an open source project under .NET platform which is a complex application system framework mainly formed by integrating with other open source projects. Castle framework can help you get more done with less code and in less time, as well as simplify Web applications.
     This thesis mainly illustrates two core mechanisms of Castle framework - - IOC mechanism and AOP mechanism.Firstly, the historical development course of the two mechanisms and their exact manifestation in Castle framework has been discussed. Next, the advantage and superiority of two kinds of mechanisms in a concrete application has been analyzed separately. Then , a visual configuration tool for IOC and AOP is designed in order to simplify programmer's workload when they design an application system based on IOC and AOP mechanisms of Castle, which provides a good platform for the generation of config files based on IOC and AOP. Besides, in order to test the visual config tool and show advantage of the two mechanisms, a base station management module of a wireless network resource management system which is based on the two mechanisms is developed utilizing the visual tool. Except for some basic operations (insert、delete、modify and search),this module has also realized some functions, such as log、transaction and authority services which make the MIS system more integrated. Of course, the latter functions are based on the IOC and AOP mechanisms.
引文
[1]Castle官方网站.http://www.castleproject.org/,2005-03.
    [2]Rod Johnson.Expert One-on-One J2EE Design and Development.Wrox[M],2002.18-66
    [3]刘晓华.精通.NET核心技术原理与构架[M].北京:电子工业出版社,2002.33-36
    [4]张立编C#2.0宝典[M].北京:电子工业出版社,2006.12-16
    [5](美)普拉持(Platt.D.C.)著,黄慧萍等译.Microsoft.NET精髓[M].北京:机械工业出版社,2003.45-48
    [6]刘振岩.基于.NET的WEB程序设计-ASP NET标准教程[M].北京:电子工业出版,2006.22-25
    [7]郝刚,袁永刚,严治国.ASP.NET 2.0开发指南[M].北京:人民邮电出版社,2006.55-59
    [8]王勇,盖江南.ASRNET宝典[M].北京:电子工业出版社,2002.35-38
    [9]孟宪会,张慧妍.ASP.NET 2.0应用开发技术[M].北京:人民邮电出版社,2006.10-17
    [10]Tom Archer.C#技术内幕[M].北京:清华大学出版社,2002.78-81
    [11]Joseph Mayo著,王启丁,高锦文等译.C#技术内幕[M].北京:机械工业出版社,2004.67-75
    [12]Jeffrey Richter著,李建忠译..NET框架程序设计[M].北京:清华大学出版社,2003.101-107
    [13]Jagger Jon,Sharp John.Microsoft Visual C#.NET Step by Step-Version 2003[M].America:Microsoft Press,2003.220-243.
    [14]Christian Holm,Mike Kruger,Bernhard SpuIDa著,薛兴涛,袁勤勇译.C#软件项目开发全程剖析:全面透视SharpDevelop软件的开发内幕[M].北京:清华大学出版社,2003.8-16
    [15]罗时灼.精通Spring[M].北京:电子工业出版社,2005.14-50
    [16].NET轻量级IOC框架http://www.cnblogs.com/VictorLiu/archive/2007/O5/21/689496.html,2007-03
    [17]NHibernate for.NET.http://www.hibernate.org/343.html,2006-11
    [18]孙卫琴.精通Hibernate:Java对象持久化技术详解[M].北京:电子工业出版社,2005.33-82
    [19]陶再平.基于对象-关系映射技术的数据库应用系统的开发.电脑知识与技术,2007.10(3):902-904
    [20]企业级开源软件大盘点.http://news.csdn.net/n/20061016/96235.html.2006-10.
    [21]万长鹏.基于ASP.NET+Castle框架的旅游管理系统的设计[J].成都信息工程学院学报,2007.22(4):458-461
    [22]刘艳争.基于MonoRail框架技术的万方内部商务信息系统构建研究:[硕士学位论文].成都:西南交通大学计算机系,2007
    [23]Castle IOC容器与Spring.NET配置之比较. http://www.cnblogs.com/Terrylee/archive/2006/O4/25/38414 9.html,2006-04
    [24]Castle Aspectsharp http://www.castleproject.org/aspectsharp/index.html,2005-03
    [25](美)沃尔斯,(美)布雷登巴赫著,李磊,程立,周悦虹译.Spring in Action中文版.北京:人民邮电出版社,2005.25-31
    [26]林信良.Spring技术手册[M].北京:电子工业出版社,2006.9-15
    [27]黄强.基于IOC和AOP的服务框架核心研究与设计:[硕士学位论文].成都:西南交通大学计算机系,2006
    [28]梅峰.基于Spring实现J2EE企业应用开发框架的研究与应用:[硕士学位论文].武汉:武汉理工大学计算机系.2007
    [29]Windsor Container(IOC Container)Document of Castle framework http://www.castleproject.org/container/documentation/vlrc3/index.html,2005-03
    [30]Siobhan Clarke,Elisa Baniassad.Aspect-Oriented Analysis and Design[M].American:Addison-Wesley Professional,2005.324-329
    [31]Filman R E.Aspect-Oriented Software Development[M].America:Addison-Wesley Professional,2004.201-206
    [32]陈鑫,黄迪明等用SPRING AOP实现松散耦合[J].计算机与信息技术,2006.72-74
    [33]Y.Shen,H.Chen.Extending SOFL features for AOP Modeling[J].Engineering of Complex Computer Systems,2005,5(2):14-15
    [34]Robin A.Reynolds-Haertle.OOP with Microsoft Visual Basic.NET and Microsoft Visual C#.NET Step by Step[M].北京:世界图书出版公司,2003,66-69
    [35]张逸.AOP技术研究及其在.Net中的实现:[硕士学位论文].成都:四川大学计算机系,2007
    [36]Ramnivas Laddad.AspectJ in Action:Practical Aspect-Oriented Programming[M].Greenwich:Manning Publications Company,2003,4-31
    [37]陈垚.基于AOP的轻量级解耦框架的设计与实现:[硕士学位论文].沈阳:东北大学计算机系,2006
    [38]李志纯.面向Aspect编程的应用研究[J].计算机技术与发展,2006.16(5):217-219
    [39]Castle AutoTransaction.http://www.castleproject.org/services/transaction/index.html 2005-03
    [40]Dong,J.Yang,S.Zhang.a Web Service for Visualizing Design Patterns on Demand[J]..Information Technology Coding and Computing,2005,2(4):385-391
    [41]Resendiz.Dynamic Invocation of Web Services by Using Aspect Oriented Programming[J].Electrical and Electronics Engineering,2005,9(2):4-51
    [42]李伟.数据库原理及应用[M].北京:北京工业大学出版社,2002.120-125
    [43]杨开英.数据库系统概论[M].武汉:武汉理工大学出版社,2003.96-103
    [44]万江平.软件工程[M].北京:交通大学出版社,2006.76-82
    [45]Microsoft.PlatformSDK.http://msdn2.microsoft.com/zh- cn/default.aspx,2005-08.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700