我来帮你,最近我也在看corba!
Instance-per-client:每当一个客户试图连接时,corba对象就会产生一个实例!只要客户与服务器的连接没有断开,此实例就一直存在。
Shared Instance:corba对象仅仅创建一个实例 !你说的不错,要看是否需要记录中间层的状态来决定用哪种实例方式。
我认为如果是对一有效性检查或者函数计算可以用Shared Instance,如果对数据库进行增删改操作,则应用Instance-per-client模式。

解决方案 »

  1.   

    谢谢cszhz,cobi
    cszhz,有些道理,那就是对数据库增删改,查询都需要Instance-per-client,另外如增加操作
    里有一些计算呢,如保存后需要一些后端的计算,那就是说计算需要一个Corba对象,数据模块
    为一Corba对象,两者可以选择不同的实例模型,这可能也就是李维书上的各中企业对象吧,但
    两者如何联系呢
    在此谢谢
      

  2.   

    (zswang抱了一堆葵花宝典找呀找呀)
      

  3.   

    //from help
    Use the CORBA Data Module wizard to create a data module that can be accessed remotely by CORBA clients. A CORBA data module resides in the application server between a client and server in a multi-tiered database environment.To bring up the CORBA Data Module wizard:1. Choose File|New|Other to open the New Items dialog box.
    2. Choose the tab labeled Multitier.
    3. Select the CORBA Data Module item in the list view.CORBA Data Module wizard optionsClass NameEnter the base name of the object that implements the CORBA interface for your remote data module. The class name for your remote data module (a descendant of TCorbaDataModule) will be this name with a T prepended. It implements an interface named using this name with an I prepended. To enable a client application to access this remote data module, set the RepositoryID property of the client application抯 CORBA connection component to the base name you specify here.InstancingUse the instancing combo box to indicate how your CORBA server application creates instances of the CORBA data module. The following table lists the possible values: Value MeaningInstance-per-client A new CORBA data module instance is created for each client connection. The instance persists until a timeout period elapses with no requests from the client. This allows the server to free instances when they are no longer used by clients, but runs the risk that a CORBA data module may be freed prematurely if the client does not use the data module抯 interface often enough.
    Shared Instance A single instance of the CORBA data module handles all client requests. Because all clients share the single instance, it must be stateless.Threading ModelUse the threading combo box to indicate how client calls invoke your remote data module抯 interface. The following table lists the possible values: Value MeaningSingle-threaded Each data module instance is guaranteed to receive only one client request at a time. Instance data is safe from thread conflicts, but global memory must be explicitly protected.
    Multithreaded Each client connection has its own dedicated thread. However, the data module may receive multiple client calls simultaneously, each on a separate thread. Both global memory and instance data must be explicitly protected against thread conflicts.