|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-07-09 17:12:32
|
Hi everyone,=0D=0A=0D=0AI have a remaining issue with the JDBC package. W= hen the application is Locale aware, we would often have the object read = from the database and/or sub-objects localized for the user to serve.=0D=0A= =0D=0AI see two approachs:=0D=0A=0D=0A1) create an object having data for= all supported languages.=0D=0A2) knowing the user Locale, pick from the = database only the Locale matched data.=0D=0A=0D=0AThe approach 1 will hav= e a performance drawback as all objects contain unused data. The bean get= ters must also have a Locale parameter. In views, it will be a nightmare.= =0D=0A=0D=0AThe approach 2 seems to me far better. But in the rowmap meth= od, the User Locale has to be known to properly set the object. And here = is the issue. For time being, I declare a 'run' method in the MappingSqlQ= uery subclass which set a Locale class property and call execute with its= others arguments. The method must be synchronized to be threadsafe as I = use a class variable. This works, but I guess synchronizing the request i= s not a good long term solution due to the performance impact.=0D=0A=0D=0A= What could be very cool in this situation is an execute method taking a L= ocale parameter, just to pass on the rowmap method.=0D=0A=0D=0AIt would b= e, as I see, only a matter of adding signatures on the 'execute' and 'row= map' methods for having ones with Locale transport.=0D=0A=0D=0AWhat is yo= ur feel about this? Could I go for these adds? Has anyone a better soluti= on to propose?=0D=0A=0D=0ARegards,=0D=0AJean-Pierre=0D=0A=0A=0A**********= L'ADSL A 20 EUR/MOIS**********=0ATiscali propose l'ADSL le moins cher du= march=E9 : 20 EUR/mois et le modem ADSL offert ! =0APour profiter de cet= te offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/=0A= Offre soumise =E0 conditions.=0A |