欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    A Comparison of Jini and CORBA.ppt

    • 资源ID:377814       资源大小:270KB        全文页数:41页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    A Comparison of Jini and CORBA.ppt

    1、A Comparison of Jini and CORBA,Andrew See Liyuan Yu Zhongying Wang Michael Collins,Outline,Introduction Motivation Overview Jini Background Design/Implementation CORBA Background Design/Implementation Comparisons Architectural Comparison Ease of use Performance Reusability,Motivation,Middleware is i

    2、mportant for distributed computing Jini & CORBA are two solutions Jini & CORBA differ in subtle ways We want to compare Jini and CORBA: Conceptual Architectural Comparison Practical Performance study Reusability of an example system.,Overview,Game project Develop text based distributed game system L

    3、imited time: no fancy graphics Fair comparison: easy to express in both Jini & CORBA use strings only Variety of games in same network. Use name service of Jini & CORBA,Jini,Jini Background,Embedded hardware is network-centric, not disk-centric Networks are dynamic; so is Jini Object interface; not

    4、network protocol Service: A network-accessible device that provides a useful function Client: Any user who requests services,Runtime Architecture,Federation of services No central authority Lookup Service Directory of currently available services Services can be searched by clients Execution of serv

    5、ices is independent of Jini As backup, Jini also allows network protocol,How Jini Works,Separation of Interface & Implementation,Services may grant varying access to clients Entire service is downloaded and run locally Service object is a proxy to remote server Methods are remote calls to service, w

    6、hich actually does the work Both local and remote objects share work,Separation of Interface & Implementation,Client is not required to know network protocol between proxy may communicate using RMI, CORBA, DCOM, etc.,Jini Program Design,Player One player for all Games Games Separate communication fr

    7、om game specific rules Generalize common game tasks Add/remove a player Take a turn Update Player state,Design Games,Interface Game,Interface RemoteGame,Interface GameProxy,AbstractGame,BasicGameProxy,TurnBasedGame,GuessingGame,Hangman,Blackjack,HangmanProxy,BlackjackProxy,Design Players,Terminal an

    8、d GUI based clients have same functionality.,Implementation,Server,Jini name service,Register,Lease,Remote Game,GameProxy,Player,Lookup,GameProxy,GameProxy,addPlayer, TakeTurn,addPlayer, TakeTurn,(local processing),Implementation Code samples,Creating the server-side object: Game impl = new Guessing

    9、Game(); RemoteGame implProxy = (RemoteGame)exporter.export(impl); Creating the proxy: smartProxy = new BasicGameProxy(implProxy); Registering the proxy: ServiceItem item = new ServiceItem(null, smartProxy, attrs); reg = registrar.register(item, Lease.FOREVER);,Implementation Code samples (cont.),Pla

    10、yer taking a turn: Player: protected void takeTurn(String action)game.takeTurn(action,id); GameProxy this version just forwards to remote implementation: public void takeTurn(String action, Object id) throws RemoteException impl.takeTurn(action,id); player.setGameData(data); The rules for the game c

    11、ould be in the RemoteGame implementation, or the Game Proxy, or split between them.,CORBA,What is CORBA?,Common Object Request Broker Architecture (CORBA) specification defines a framework for object-oriented distributed applications It is an open standard for heterogeneous computing. Allows distrib

    12、uted programs in different languages and different platforms to interact as though they were in a single programming language on one computer,Object Request Broker (ORB),A software component that mediates transfer of messages from a program to an object located on a remote host.,Network,Server,1,2,3

    13、,execution,4,5,6,7,0,invocation,ORB,ORB,Client,0. Invocation ( with an object reference)1. Locate CORBA objects and marshal parameters2. Network Delay 3. Unmarshal parameters4. Method Execution5. Result marshal6. Network Delay 7. Result unmarshal,CORBA Object,CORBA Objects and IDL,Each CORBA object

    14、has a clearly defined interface specified in CORBA interface definition language (IDL). Distributed objects are identified by object references, which are typed by the IDL interfaces. The interface definition specifies the member functions available to the client without any assumption about the imp

    15、lementation of the object.,Example of IDL,stockMarket.idlmodule stockMarketinterface StockServer float getStockValue (in string stockName);void setStockValue (in string stockName, in long value); No Implementation details in IDL,Stub and Skeleton,“Glue” that connects language-independent IDL interfa

    16、ce specifications to language specific implementationAutomatically generated by IDL compiler,Design of the Game Project with CORBA,Centralized Version:,Two Games:,Guess Game:,Two Games (Cont.),HangMan:,Design Details-IDL,module GameAppinterface Playervoid displayMessage(in string m);string getPlayer

    17、ID();interface GuessPlayer: Player;interface HangmanPlayer: Player void drawMan(in long numWrong);,interface Servervoid addPlayer(in Player p);void removePlayer(in string playerID);void startGame(in string playerID);void QuitGame(in string playerID);void takeTurn(in string playerID);interface GuessS

    18、erver: Servervoid takeTurn(in long number, in string playerID);interface HangmanServer: Servervoid takeTurn(in char w,in string word, in string playerID); ;,Design Details-UML,Design of the Game Project with CORBA,Decentralized Version,Naming Service,register Service,Design Details-IDL,module GameAp

    19、p interface Playervoid receiveMessage(in string m); string getPlayerID();void startGame(in string data);void startNewGame(in string data);void QuitGame();void response(string number, in string data);void takeTurn();interface Serverstring addPlayer(in string p, in string ncRef);,Design Details- UML,I

    20、nterface generated By IDL Compile,Implement by programmer,Notes for CORBA decentralized version,The server do an only job: to find the partner for each client. This function also can be implemented by Name Service, So server is not essential component. The client need implement all the functions for

    21、 communicate each other and playing the game Adding more games, or changing the game rules, need to Change class PlayerImpl, which implements main functions for client, and class server, and some minor changes to other classes.,Comparison,Architectural comparisonEase of usePerformanceReusability,Arc

    22、hitectural Comparison,CORBA used RMI Jini uses anything rmi, corba, tcp, etc.Jini uses Suns services CORBA uses many ORBs & separate servicesJini uses Java only CORBA uses any language + IDLJini allows pass-by-value and pass-by-reference pass-by-value uses object serialization pass-by-reference uses

    23、 RMI CORBA only does pass-by-reference,Architectural Comparison Example,Events: Jini sending event same as a method call to a RemoteEventListener CORBA separate EventChannel is used to relay events can be Push based or Pull based. Push and Pull and interoperate Conclusion: Jini is simpler CORBA is m

    24、ore powerful for events,Comparison Events,Event Source,RemoteEvent Listener,Register,notify(RemoteEvent),Jini:,Event Source,RemoteEvent Listener,CORBA:,Event Channel,connect,push,connect,push,pull,pull,Ease of use,Similarities: Registering with name service: Find name server Add binding About the sa

    25、me in Jini & CORBA Looking up a service/object Also same in Jini & CORBA Error Handling Code needs to deal with possible network problems,Ease of use,Differences: Networking In CORBA: IDL compiler does all network handling Interfaces are created for building the service In Jini: Programer needs to m

    26、ake network decisions Often put into configuration files This reflects a difference in philosophy CORBA wants remote objects to look same as local objects Jini wants programmer to deal with network efficiently.,Performance,Simulated user input driven program: 10 rounds of 100 method calls Jini versi

    27、on downloads code and runs locally,Performance,Centralized Guessing game test Not randomized. Played 100 times,Reusability,Method: Start with Guessing game Reuse code to make a new game In both cases little change was needed In CORBA: methods added to IDL game rules modified in Java Networking and book-keeping did not change In Jini: Abstract classes dealt with networking and book-keeping Subclasses implemented game rules Conclusions: Both Jini and CORBA facilitate reusable code,


    注意事项

    本文(A Comparison of Jini and CORBA.ppt)为本站会员(孙刚)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开