论文研究-Applying Web Services to RIA Applications.pdf

所需积分/C币:5 2019-08-16 18:50:09 283KB .PDF
收藏 收藏
举报

Web服务在RIA开发中的应用,赵嘉,许可,互联网广泛应用以来,应用程序的架构经历了多次变革,一般可分为C/S和B/S两个模式。C/S的部署和更新不方便,B/S缺乏友好的用户体验,��
国科技论文在线 http:/www.paper.edu.cn complement to rich client and ria 90 2,2 Web service based ria architecture RIa applications usually runs in an cnvironment designed as a plug-in of the wcb browser, whose purpose is to be compatible with Web as much as possible and to acquire friendly user experience and convenient operation like desktop applications Figure 1 shows a Web Service based Ria architecture 95 The client existing in the typical form of a plug-in of a web browser has a three-layer structurc. Of thc thrcc layers, the top laycr is the prcscntation laycr. It usually contains rich uscr interface elements and complex display logic. In the middle is a business layer which contains business components to run the client. The scale of this layer is related to the specilic type of RIA, which can range from thin interfaces that overlay server-side business services, to complex 100 applications that perform most of the business logic themselves and only communicate with server-Side Web services to request and send information. The last layer of the client is a web Service agent component that makes the application architecture soa architecture through which RIA applications can interact with the Web Services hosted by remote server RIA client architecture is not always like the one we described above, but changes according to the concrete 105 busincss requirement Presentation layer rowse Client Local Storage Plug Business Layer Service agent Web Services Server Business layer Data Layer Fig. I Web Service based ria architecture As is shown, the local storage part is optional in terms ofarchitecture. It is different from the 110 web browser's cookie and cache. Local storage plays an important role to improve the client responsc spccd and providc fricndly uscr cxpcricncc, so most RIa will consider including it. [2 3.NET example of ria Web service invocation In this section, we present an implement of the whole process of the Web Service invocation in RIA application in the Nct platform as an cxamplc. Wc will statc stcp by stcp the invocation 115 process by showing the problems we met and corresponding solutions we made 3.1 Invoke through proxy The most basic Web service consuming is implemented through proxy class mechanism. [8J[12] Proxy class is the one that encapsulate all the request and return action must be compiled before application's code can use it. So. Net developers often use Visual Studio. Net Ide directly 120 to find and add web service to their projects or use a visual studio shipped wsdl command line 山国科技论文在线 http:/www.paper.edu.cn tool to manually compile the proxy class ahead of time. Once the proxy class is successfully compiled, application codes can use it to consume the Web Service transparently as local methods This results in an inflexibility problem. Client code and web service proxy class are tightly coupled together which does not conform the design principles of loose coupling, and a tiny 125 update in Web Service server will force the proxy class referenced by client side application to be recompiled, thus making the client side application require an update at the same time a probable method to solve this problem is the use of Net provided classes ScrviccDcscriptionlmportcr and CodcDomProvidcr. Thcy can rcalizc the runtimc dynamic 130 generation of client side Web Service proxy class. Proxy class generated by the two classes is ompiled into a dynamic link library lile and application code can access it through reflection call In the way, the couple between client code and proxy class is transformed into one between client and the Web Service method signature, thus making the client development independent of the server-side Web Service changes The detail steps are as foll 135 1. Read from the configuration files the Web Service address and name 2. Request Wsdl documents from the server 3. Parsc the wsdl filc for service description object by using ScrviccDescription Importer 4. Pass the service description object returned by step 3 as a parameter to CodeDomProvider and the latter can generate dynamic link library file accordingly. 140 5. Invoke methods by reflection 3.2 Proxy for proxy However, the invocation implement in reflection way must pay for the performance cost of reflection mechanism itself which means we need a better solution. Fortunately, many current popular enterprise application frameworks(Spring. Net, for example) provide the proxy factory 145 mechanism which is able to implement the specific interface automatically at runtime. The proxy factory, referencing the type information of the generated dlL lile and Web Service interface definition, can create a proxy for the proxy mentioned in the above section, namely the Web scrvicc agent in Figurc 1. In this way, couple bctwccn client codc and Wcb Scrvicc mcthod signature is transformed into the one between application code and interface definition whose 150 concrete implemenLation will be generated at runtime 3.3 Implementation details Based on solution proposed in previous section, we depict in this section the implement details of the proxy for proxy way to consume Web Service As is shown in Figurc 2, ProxyMakcr class holds two members which arc instances of class 155 ServiceDescriptionlmporter and class CodeDomProvider. The client application reads from configuration files the address of web service and access the address to get the wsdl documents After the WSDL file is read, Service Descriptionlmporter take it as its input parameter and parse it to an intermediate object (service description object) and return it. The latter takes the responsibility of crcating scrvicc proxy for NctProxy class and compiling it into dynamic link 160 library file at runtime according to the intermediate object returned by the latter 4 国科技论文在线 http:/www.paper.edu.cn <<datatype>> WSDL Applicatio <<cdl|>> <<read>> <<intertace>> Servicelmpl -Service DescriptionImporter CodeDom Provider Compiled +ParseWSDLO <<create <<create>> Proxy Factory NetProxy ProxyType Fig 2 Implementation class di agran ProxyFactory's dependence on Inter face and NetProxy can easily be implemented in 165 configuration file. This paper uses the Spring. Net framework configuration file style like Figure 3: object type="Spring. Web Services. ProxyFactory, Spring. Services"> <propert name="Proxylype value="SomeNS. Example. NetProwy, GeneratedD11"/> 彐< property name="Interface value="Org. Services Service, my Services"/> <object> ig. 3 Configuration Filc Scgmcnts The two type dependencies of Proxy Type and Interface that Proxy Factory holds are shown in 170 Figure 2 as two dotted line arrows, which will be dynamically injected by the loc container [15]at run-time. Proxy Factory finishes its task by processing the two injected dependencies, that is, type of Scrvicc and NctProxy got by Nct reflection. Proxy Factory implements the Scrvicc interface according to the type information using MsIL. It searches the NetProxy for matching method to realize the service interlace and throws an exception if no matching method exists 175 The whole procedure can be expressed by Figure 4. Client codes dependence relationship with Service interface has been determined at design-time so it can directly invoke methods of this intcrfacc. Spccific interface implementation is gcncratcd aftcr the Framework is initialized and ProxyFactory is loaded and NetProxy are generated 国科技论文在线 http:/www.paper.edu.cn cation Framework Interfacelmpl ProxyFactory Interface NetProxy ProxMaker Web Service Init WSDL Request i CompileResultWSDL File TypeInfo getTypeInfo Fig 4 Web Service invocation procedure 4 Summary and future work In this paper, we discussed the ria application and we gave a brief introduction to Service-Oriented RIa application. Then we presented an architecture in which web service was 185 used with Ria application(which we called Web Service based RIa). In section IV, we presented a new implementation of Web Service invocation in a. Net client as an example to solve the inflexibility problem that traditional proxy class way brought The architecture put forward in this paper is just a simple solution of feasibility. When it comes to real enterprise application development scenarios, many other factors are still to be 190 considcrcd such as sccurity issuc, performance rcquircmcnt and deployment policy. In addition, the local storage solution that was not discussed in this paper is important and also the future work to be addressed References 195 [1] Piero Fraternali, Gustavo Rossi, and Femando Sanchez-Figueroa, Rich Internet Applications[J]IEEE Internet Computing,2010,14(3)9-12 [21 Qi Zhao. Towards a data access framework for Service-Oriented Rich Clients[ C]. Perth, WA: IEEE Conference. 2010.13-15 [3] Melia S A model-driven development for GWT-based Rich Internet Applications with OOH4RIA[C] 200 Yorktown Heights, NJ: IEEE Conference, 2008.13-23 4] Qi Zhao. a browser-based middleware for Service-Oriented Rich Client[C]. Hangzhou IEEE Conference. 2010.22-27 [5] Alor-Hcrnandcz g Ria optimization to support Wcb Scrvicc invocation on mobilc Safari for Phone C]. Porto: IEEE Conference, 2009.39-44 205 6] Fei Wang. The development of Rich Internet Application based on current technologies[C]. Shanghai: IFEI Conference, 2009.815-818 [7] Pietschman S Dynamic Composition of service-oriented web user interfaces[C]. Venice/Mestre: IEEE Conference. 2009.217-222 [8] Amalfitano D Techniques and tools for Rich Internet Applications testing[C]. Timisoara: IEEE 210 Conference. 2010.63-72 [9] Qu Hai-Cheng. Application of RIA Systcm Intcgration Bascd on Wcb Scrviccs[J]. Computcr Systcms Applications, 2010, 19(9): 15-19 [10] Kong Yunfeng. A Web-based Geographic Hypermedia System: Data Model, System Design and Prototype Applications[J]. Geo-spatial Information Science, 2011, 14(4): 294-302 215 [11] Lin Zheng. Numerical simulation platform of main stream water quality within the Three Gorges Reservoir 国科技论文在线 http:/www.paper.edu.cn area based on WebGIS[J]. Resources and environment in the Y angtze Basin, 2012, 21(8): 988-993 [12] Alor-Hernandez GTowards dynamic representation of Rich Internet Applications through Web Service invocation[c]. Porto: IEEE Conference, 2009. 33-38 3 Peintner D Efficient XML interchange for Rich Internet Applications[C]. New York: IEEE 220 Conferenc. 2009.149-152 14 eremy Allaire Macromedia Flash MX-a next-generation h client[ol]-[2002].http:/'download.macromedia.com/pub/flash/whitepapers/richclient.pdf [15 Martin Fowler. Inversion of Control Containers and the Dependency Injection pattern[ol]-[2004].hTtp://martinfowler.com/'articles/injection.html 225 web服务在RIA开发中的应用 赵嘉,许可,杨俊 (北京邙电大学PCN&CAD实验中心,北京100876) 摘要:互联网广泛应用以来,应用程序的架构经历了多次变革,一般可分为CS和B/S两个 230模式。C/S的部署和更新不方便,BS缺乏友好的用户体验,这些是难以解决和避免问题。 开发人员需要新的技术来解决这些问题,RIA是一个合适的选择。Web服务是SOA的最住实 践,更适合分布式应用系统的构建。本文提出将Wb服务与RIA结合的系统架构方案。本 文首先概述RIA架构和相关研究,然后给出一个基于Web服务来构建RIA应用程序的架构, 最后提供一个Net平台下基于 SOAP Wcb服务调用的实现 235关键词:计算机软件与理论;Web服务;RIA;SOA 中图分类号:TP

...展开详情
试读 7P 论文研究-Applying Web Services to RIA Applications.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    抢沙发
    一个资源只可评论一次,评论内容不能少于5个字
    上传资源赚积分,得勋章
    最新推荐
    论文研究-Applying Web Services to RIA Applications.pdf 5积分/C币 立即下载
    1/7
    论文研究-Applying Web Services to RIA Applications.pdf第1页
    论文研究-Applying Web Services to RIA Applications.pdf第2页
    论文研究-Applying Web Services to RIA Applications.pdf第3页

    试读已结束,剩余4页未读...

    5积分/C币 立即下载 >