Re: CORBA question



Hello, Dietmar:

On Sat, 21 Apr 2001, Dietmar Maurer wrote:

> Hi everyone.
> 
> Maybe someone of you know the answer: CORBA has those Contexts - client
> site attributes which are sent to the server. Is it somehow possible to
> specify such attributes for an object reference, which are then sent to
> the server each time I call a method on that object. For example if I
> have a database which stores localized values:
> 
> interface Database {
> 
>     any getValue (in string key, in string locale);
> 
>     ... many other methods, which all needs those locale parameter
> };
> 
> another way would be to use Contexts:
> 
>     any getValue (in string key) context ("locale");
> 
> which only makes it more difficult to use (see C language mappings). So
> what I would
> like to have is:
> 
> 
> interface Database context ("locale")  {
> 
>     any getValue (in string key);
> 
> };
> 
This is not standard CORBA.

> I can then set the locale once on the object reference at the client,
> which is the passed to the
> server each time I call a method on that Object.
> 
Note that object references are only "client-side" representations of a
server object, and that these references are not "passed" to the server
ORB. Only the object key (which represents the target object) is passed to
the server ORB (see H&V book, page 616).

> So is there a way to do such things in CORBA?
What you propose is not doable in a way different from a 
context for each operation. 

Note however, that if I understood well the question, you can do it
several times easier than what you propose. Imagine that you obtain a
Database object with an operation "setLocale". The corresponding server
object will know from that point what is the locale it must use. 

This means that you must have "active" at least a Database object per
locale. Note that I use "active", not "allocated", as all the requests can
be served by only one object using the correct POA policies.

If you know the locale beforehand, you even can create objects whose
object key includes the locale (say "es_xxx", where xxx identifies _that_
Database object).

Another one more thing, and sorry for my little knowledge of C mapping,
but, isn't it that you can share context properties between different
client-side invocations? Just curious of context use in client-side C.

> 
> - Dietmar
> 
	Finally, contexts seem to be some "bastard" CORBA
constructs. They are not typed, and almost 90% times, context objects (as
in the "setLocale" operation) are preferred.

	Regards and hope this helps.
	diego.

--
Diego Sevilla Ruiz -- http://ditec.um.es/~dsevilla/ -- dsevilla um es
Dep. Ingeniería y Tecnología de Computadores, Facultad de Informática
Univ.de Murcia,Campus Espinardo,30080 Murcia (SPAIN),Tel.+34968367658
lynx -dump ditec.um.es/~dsevilla/face |uncompface | ikon2xbm |display
PGP:  http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xC9B964B7
perl -e'$_="\x4\ FLe\x2&B";for(/../g){print unpack("b*",$_),"\n"}'|tr 01 " #"





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]