首页>
外国专利>
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.
展开▼