首页> 外国专利> Method and apparatus of using a single computer program source code base to provide a program that is operable in either a client-server mode or a standalone mode

Method and apparatus of using a single computer program source code base to provide a program that is operable in either a client-server mode or a standalone mode

机译:使用单个计算机程序源代码库提供可在客户端-服务器模式或独立模式下运行的程序的方法和装置

摘要

A method and apparatus for using a single computer program code base to provide a program that is operable in either a client-server mode or a standalone mode are provided. In one embodiment, a client logic element has one or more proxy objects, each of which implement an interface that is neutral with respect to the client-server mode and the standalone mode. A server logic element has one or more service objects. Each of the service objects implements the interface. The interface implementations are not bound to any code that is specific to the client-server version or the standalone version. In the stand-alone version, the client side logic invokes the server side logic directly through the interfaces, as implemented by the service objects. In the client-server version, the client side logic invokes the server side logic through the same set of Java interfaces. However, the interfaces are implemented by the proxy objects, which internally implement a transport mechanism to forward the method invocation and parameters to the server side through a servlet API. In response, a servlet identifies the corresponding service object and invokes the corresponding method with serialized parameters. When the method returns, the resulting object, which can be a new proxy object, is serialized back into the proxy object for the invocation and from there the result is returned to the client side logic. Using this mechanism, the client side logic only interacts with the Java interfaces, without the need to know whether it is dealing with service objects or proxy objects. Accordingly, the client side logic is shielded from any version-specific code. In addition, the same runtime environment can support both the client-server version and the standalone version.
机译:提供了一种使用单个计算机程序代码库来提供可在客户端-服务器模式或独立模式下运行的程序的方法和装置。在一个实施例中,客户端逻辑元素具有一个或多个代理对象,每个代理对象实现相对于客户端-服务器模式和独立模式而言是中立的接口。服务器逻辑元素具有一个或多个服务对象。每个服务对象都实现该接口。接口实现未绑定到特定于客户端服务器版本或独立版本的任何代码。在独立版本中,客户端逻辑直接通过服务对象实现的接口调用服务器端逻辑。在客户端服务器版本中,客户端逻辑通过同一组Java接口调用服务器端逻辑。但是,接口是由代理对象实现的,代理对象在内部实现了一种传输机制,以通过Servlet API将方法调用和参数转发到服务器端。作为响应,小服务程序标识相应的服务对象,并使用序列化的参数调用相应的方法。当方法返回时,结果对象(可以是新的代理对象)被序列化回用于调用的代理对象,然后从那里将结果返回到客户端逻辑。使用这种机制,客户端逻辑仅与Java接口进行交互,而无需知道它是在处理服务对象还是代理对象。因此,客户端逻辑不受任何特定于版本的代码的影响。此外,同一运行时环境可以同时支持客户端服务器版本和独立版本。

著录项

  • 公开/公告号US6769123B1

    专利类型

  • 公开/公告日2004-07-27

    原文格式PDF

  • 申请/专利权人 CISCO TECHNOLOGY INC.;

    申请/专利号US20000656537

  • 发明设计人 CHI-CHOI CHAN;

    申请日2000-09-07

  • 分类号G06F30/00;

  • 国家 US

  • 入库时间 2022-08-21 23:18:06

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号