From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,d5d07870ceba68c X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-08-29 18:05:44 PST Path: bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!yeshua.marcam.com!usc!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!newsfeed.ACO.net!Austria.EU.net!EU.net!uunet!isoft!jec From: jec@isoft.isoft.com (Jonathan Chinitz) Newsgroups: comp.unix.osf.misc Subject: Re: OSF-DCE: 2 interfaces at the same time? Keywords: OSF DCE type manager interface Message-ID: <389@isoft.isoft.com> Date: 30 Aug 94 00:39:26 GMT References: <33s2i5$7va@gmdzi.gmd.de> Organization: IntelliSoft Corp., Acton MA In article <33s2i5$7va@gmdzi.gmd.de>, lux@gmdzi.gmd.de (Wolfgang Lux) writes: > can an object possess 2 interfaces, i.e. 2 responsible type > managers, at the same time? > > idea: > an object has a > - type-specific interface, f.i. enter_date, and at the same time > - a type-independent interface, f.i. get_usage_info. > > the type manager implementing the type-independent interface is > attached to every object in addition to the type-specific manager. > > Wolfgang Lux Sure! You assign a manager type uuid to each manager type, and register the interface twice: once with each manager type. Then you assign an object uuid to each manager type and make that visible to the client, either thru the namespace entry or in the client code as a constant. Your calling sequence is: uuid_create (mgr-type1, st) uuid_create (mgr-type2, st) rpc_object_set_type(obj1, mgr-type1, st) rpc_object_set_type(obj2, mgr-type2, st) rpc_server_register_if(if, mgr-type1, mgr_epv1, st) rpc_server_register_if(if, mgr-type2, mgr_epv2, st) When you call rpc foo() on interface if, you set the object uuid in the binding handle either by calling rpc_binding_set_object() or by importing the binding from CDS and passing the object uuid in the call to rpc_ns_binding_import_begin(). Depending on the object, the manager code that will get executed will be either (*mgr_epv1->foo)() or (*mgr_epv2->foo)(). If you want a default behaviour, then make a third register_if call with mgr-type == NULL. Bindings that have no object will always execute in the default mgr epv. Jonathan -- Jonathan Chinitz E-mail: jec@isoft.com IntelliSoft Corp. Tel.: 508-635-9070 Distributed Computing Solutions Fax: 508-635-9210 P.O. Box 2645, Acton, MA 01720