交通大学资讯工程学系80144

上传人:n**** 文档编号:83409174 上传时间:2019-02-27 格式:PPT 页数:117 大小:1.45MB
返回 下载 相关 举报
交通大学资讯工程学系80144_第1页
第1页 / 共117页
交通大学资讯工程学系80144_第2页
第2页 / 共117页
交通大学资讯工程学系80144_第3页
第3页 / 共117页
交通大学资讯工程学系80144_第4页
第4页 / 共117页
交通大学资讯工程学系80144_第5页
第5页 / 共117页
点击查看更多>>
资源描述

《交通大学资讯工程学系80144》由会员分享,可在线阅读,更多相关《交通大学资讯工程学系80144(117页珍藏版)》请在金锄头文库上搜索。

1、Programming in Java,E J B,蔡文能 交通大學資訊工程學系 tsaiwncsie.nctu.edu.tw,2,Agenda,Introduction to EJB Why EJB ? RPC, RMI, and CORBA EJB Container Functions Types of beans EJB Application Architecture Building EJBs EJB Examples Cant Do in an EJB Application Servers,3,What is EJB?,EJB Enterprise JavaBeans Serv

2、er-side components (Not GUI components) Similar to JavaBeans in name only EJB is not JavaBean Part of J2EE architecture J2EE platform provides several APIs JDBC Servlets RMI/IIOP JavaMail JNDI EJB,4,.NET,Server Technology Timeline,Microsoft,Java,1996,1997,1998,1999,2000,2001,QC,MDB,LCE,MMC,WinDNA,J2

3、EE,VS .NET,5,J2EE architecture,RDBMS,HTML,Applet,Application,Java Application,CORBA,Client,Application Server,Data,Mail Server,Directory Service,HTTP,Web Container,EJB Container,RMI,Servlets,EJBs,JDBC,Java Mail,RMI,IIOP,JNDI,6,7,UML For javax.ejb,8,9,10,Why EJB?,Distributed Programming Easy developm

4、ent of server side applications Scalable, reliable and secure Portability and reusability Moving EJBs from one back-end to another without disruption Practical application to e-commerce systems,11,Distributed Programming?,Most client/server code did three things: The client connected to the server T

5、he client sent a request The client got a response All methods for distributed programming, at their core, must handle these three things. The way to understand an architecture is to make the above sequence into questions,12,Client/Server (C/S) Model,The fundamental questions are all client-oriented

6、 Without the client, there is no client-server If you cant resolve communications issues, theres no distributed programming Whats comes after them ? The second level of questions involves servers There are core problems and ideas that repeatedly arise whenever you build a server,13,blah, blah, blah

7、bar = foo(a,b); blah, blah, blah,int foo(int x, int y ) if (x100) return(y-2); else if (x10) return(y-x); else return(x+y); ,Client,Server,protocol,Remote Procedure Call,RPC,14,Sun RPC,There are a number of popular RPC specifications. Sun RPC is widely used. NFS (Network File System) is RPC based. R

8、ich set of support tools. RPCGEN There is a tool for automating the creation of RPC clients and servers. The program rpcgen does most of the work for you. The input to rpcgen is a protocol definition in the form of a list of remote procedures and parameter types.,15,RPCGEN,Input File,rpcgen,Client S

9、tubs,XDR filters,header file,Server skeleton,C Source Code,Protocol Description,foo_clnt.c,foo_svc.c,foo.xx,% rpcgen C foo.xx,foo_xdr.c,foo.h,16,JVM Asociated to Activation Group,RMI (in Java),Client Code,network,Naming Service,Server Object,Activation Daemon,Client Stub,Server Skeleton,Implement “F

10、actories” using declarative descriptions of activatable objects,One JVM per ActivationGroup. Automatically launched by Activation daemon and contains (potentially) many small scale, semi-independent servers which can share resources (like connection pools) and which live under the same security rest

11、rictions,“Flat” directory structure which attempts to provide some notion of location transparency- client code uses a single name to find a server,17,Find Servers using Naming Service,Simple interface to registry Implemented via 5 static methods on an object:,public static String list(String name)

12、public static Remote lookup(String name) public static void bind(String name, Remote obj) public static void rebind(String name, Remote obj) public static void unbind(String name),18,java.rmi.Naming,19,CORBA uses Naming Services,Defined in IDL Anyone can implement them; theyre just servers. ORB can

13、find at least one, by resolving a reserved name Have a richer structure than RMIs Naming Tree-like structure defined by sequences of NamingContexts,org.omg.CORBA.Object objRef = orb.resolve_initial_references(“NameService“);,IDL: Interface Definition Language,ORB: Object Request Broker,CORBA: Common

14、 Object Request Broker Architecture,20,http:/www.corba.org,21,What is CORBA? (1/2),Common Object Request Broker Architecture (CORBA) Goal: Simplify distributed heterogeneous systems software Standard (under development) for object/application interfaces mechanisms to handle them language-, operating

15、 system-, and location-independent The OMG(Founded 1989) grew out of the object technology boom of the 1980s. Its founders were Data General, Hewlett-Packard, and Sun. Today some 800 (and growing) companies comprise the OMG. Together these companies have created and continue to create standards for

16、Object-Oriented computing CORBA 1.0 (October 1991) CORBA 3.0 - Pre-release Spring 1999, Commercial release late 1999,22,What is CORBA? (2/2),Five components of CORBA : Interface Definition Language (IDL). Interface Repository (IR). Object Request Broker (ORB). Dynamic Invocation Interface (DII). Object Adapters (OA). Object Oriented, Distributed, Platform/Language independent. Allows Heterogeneous systems to d

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号