From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,897502692464f25e X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-06-16 11:49:59 PST Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!usc!enterpoop.mit.edu!paperboy.osf.org!rsalz From: rsalz@osf.org (Rich Salz) Newsgroups: comp.unix.osf.misc Subject: Re: DCE Type vs Object UUIDs (Was: Re: Multiple DCE Servers with the same Interface) Date: 16 Jun 1993 18:29:21 GMT Organization: Open Software Foundation Distribution: world Message-ID: <1vnoq1$82t@paperboy.osf.org> References: <1vk6bj$ooi@zaphod.axion.bt.co.uk> <1vkea7$oub@paperboy.osf.org> <1vn9bo$ce7@zaphod.axion.bt.co.uk> NNTP-Posting-Host: earth.osf.org In <1vn9bo$ce7@zaphod.axion.bt.co.uk> nwinton@axion.bt.co.uk (Neil Winton) writes: >(although it is arguable whether the `type' isn't really just the interface >presented). No, a type is not the interface but the implementation of that interface. Let me try again with my printer example. Suppose I have each printer as a UUID. Suppose I have a print_text operation. That does this: print_text(uuid_t printer, char *text) { if (is_a_postscript_printer(printer)) convert_to_postscript_and_print(text); else if (is_a_daisy_wheel_printer(printer)) send_text_to_printer(text); } This can get kind of messy when you have more than two types -- every function that is printer-specific must have a cascading set of if/elseif statements to handle all the cases -- and hard to administer when you have many objects. Instead, your server says at the beginning "uuida is a postscript printer" and "uuidb is a daisywheel printer" and so on. Then, when a print_text operation comes in, the RPC runtime automatically invokes print_text_ps and print_text_daisy. (You have to write those routines, and associate them with the postscript and daisywheel manager dispatch table (MEPV).) It is analogous to the standard problem of writing generic code in C: you have to put switches all over the place, or use C++ where the compiler does it for you automatically. /r$