#    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1996
#   All Rights Reserved
#   Licensed Materials - Property of IBM
#   US Government Users Restricted Rights - Use, duplication or
#   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#   @(#) 1.7 src/somples.nt/somd/c/proxy/readme.txt, somples.somd, som3.0, s309651d 12/19/96 17:51:02 [12/23/96 08:42:17]

 **********************************************************************
 * DISCLAIMER OF WARRANTIES.
 * The following [enclosed] code is sample code created by IBM
 * Corporation. This sample code is not part of any standard or IBM
 * product and is provided to you solely for the purpose of assisting
 * you in the development of your applications.  The code is provided
 * "AS IS". IBM MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE, REGARDING THE FUNCTION OR PERFORMANCE OF
 * THIS CODE.  IBM shall not be liable for any damages arising out of
 * your use of the sample code, even if they have been advised of the
 * possibility of such damages.
 *
 * DISTRIBUTION.
 * This sample code can be freely distributed, copied, altered, and
 * incorporated into other software, provided that it bears the above
 * Copyright notice and DISCLAIMER intact.
 **********************************************************************

PROXY

   DESCRIPTION:
      This directory contains a simple example of how to write a
      user-supplied proxy object.

   CONCEPT/FEATURE:
      In this particular example, the proxy object maintains a local,
      unshared copy of the attribute (attribute_long) defined
      in the remote object (Bar) while forwarding the method call
      (_method1) to the remote object. The result is that when multiple
      clients are talking to the same remote Bar object, each client has
      a local copy of the attribute but all clients share the Bar
      object's implementation of _method1. Setting the attribute in one
      client's proxy does not affect the value of the attribute in other
      proxies.

      The user-supplied proxy was created by using multiple inheritance between
      SOMDClientProxy and the target object (in this case Bar). The idl and
      implementation files for Bar are in bar.idl and bar.c respectively.
      The idl file for SOMDClientProxy is in %SOMBASE%\include.  The idl and
      implementation files for the proxy are in barproxy.idl and barproxy.c
      respectively.

      Normally one would use the "abstractparents" modifier to indicate that abstract
      inheritance should be used for the target class (e.g., Bar) of the user-defined
      proxy class, but in this sample, abstract inheritance is not desired because
      we want the proxy class (Bar__Proxy) to inherit the instance data of the Bar
      class to permit caching of instance data in the proxy.

      When you build a user-supplied proxy, you only need to override methods
      introduced by the target interface which you do not want forwarded or
      that require special processing.  In the implementation section of
      the "barproxy.idl" file, "_set_attribute_long" and "_get_attribute_long"
      are overridden to prevent the methods from being forwarded.

      Method method1 doesn't need to be overridden (it would be forwarded
      automatically), but we do it to illustrate how to explicitly cause a
      method to be forwarded.

      This sample is described in the SOMobjects Developer Toolkit Users Guide
      under the section "Creating user-supplied proxies".  However, this sample
      has changed class Foo to Bar and class Foo__Proxy to Bar__Proxy.  This name
      change was made to avoid class name conflicts with the sample in the "dii"
      subdirectory.



   HOW TO RUN THE SAMPLE:
      The makefile "vac.mak" in this directory will build a client
      executable and a dynamically loadable library.  They are:

       - tstproxy.exe (the DSOM client application)
       - objs.dll (the library loaded by the server)

      To build the sample:
       "nmake -f vac.mak all".

      To clean up the directory and implementation repository after running
      the samples:

        "somdd" must be started if it is not running.
        "nmake -f vac.mak clean".

      RUNNING THE SAMPLE
      ------------------
         The DSOM daemon, "somdd", must be started.
         Wait until "somdd" displays the "Ready" message before continuing.
         To run the sample, execute "tstproxy".

         Alternatively, you may start the server yourself by invoking
         "start somdsvr -a barServer1".  ("barServer1" is the
         server's alias name used by the makefile when registering the server
         in the Implementation Repository using the "regimpl" registration
         utility.)  After the server is started, run "tstproxy".


