Re: CORBA question



On Sat, 21 Apr 2001, Dietmar Maurer wrote:

> Diego Sevilla Ruiz wrote:
> 
> > 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).
> 
> Just to verify if I understand it: We encode the locale into the ObjectID.

Yes.

> The Database interface could then be something like:
> 
> 
> interface Database {
> 
>     Object getLocalizedObjref (in string locale);
>     string getLocale ();
> 
>     any  getValue (in string key);
> }
> 
> This is as nice a the setLocale/getLocale interface - or are there any
> other drawbacks?
> 
I don't know exactly if I understand what you're doing here. I don't know
what the "Object" return value of getLocalizedObjref means, as I was
expecting returning localized databases. Thus, I think you're mixing two
behaviors here: one for creating, managing and returning localized
databases to clients requesting them, and the other the localized database
itself. 

Thus, if you separate them in two:

interface DatabaseFactory {
	Database getLocalizedDatabase(in string locale);
};

and

interface Database {
	any getValue(in string key);
	...
}

Note that if you see the localization value as an attribute for this
particular "view" of the database, the localization isn't different from
any other parameter the database needs at creation time (such as login and
passwd to the real database, etc.) This way it works even better with
bonobo, isn't it?

Also note that, if you use ServantActivators, there is no need to
modify the ObjectId to include the locale, as you get created in the
server a database object that "knows" (via a server object's instance
variable) what locale it is serving. If you use ServantLocators, you can
implement all the localized databases using only one "Database" object and
inspecting the request's ObjectId to extract the locale.

This way even works better with Bonobo, isn't it? ;-)

	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]