|
From: Ken K. <kk...@kk...> - 2003-07-10 14:16:10
|
JP, Wouldn't simply subclassing MappingSqlQueryWithParameters be enough to get what you need ??? If it isn't, I guess I don't understand why :-( . Surely the Spring JDBC framework doesn't need to know anything about Locales and I would find the doubling of the number of convenience methods for all those classes to be troubling. Regards, Ken JP Pawlak wrote: >I'm quite talking to myself as I see. I proofed the concept and it works >fine. It was not very difficult to add a kind of 'context' from the >execute method and retrieved in the mapRow. > >I talk about a 'context' because I need today to pass a Locale, but >tomorrow someone will perhaps need somewhat else. An 'Object' will be >more indicated. > >I was careful on the ascendant compatibility thought. What is the main >work is the doubling of the convenience methods (all existing signatures >and the same with the new parameter added) and update the doc. Whereas >it's not more as a half day to a day of work. > >The only issue I found is about the mapRow method. If we maintain the >entire compatibility, when someone will use the new signature to have >the new parameter passed, it will even have to declare (as return null) >the old one which will be with no use. This is due to its abstract >nature in MappingSqlQuery. > >The classes to modify are SqlQuery, MappingSqlQueryWithParameters and >MappingSqlQuery. For coherence also SqlFunction. > >I'm happy as I found a clean way to my issue. But as it's at the heart >of the jdbc.object package, I would have any feedback before. > >As I sayed to Rod, I will not be able to work until Tuesday. At this >date I would make the changes at this date. If anyone prefer doing it, >no problem, but I can do it as I just studied these classes. > >Waiting on reaction; > >Regards, >Jean-Pierre > > >-----Message d'origine----- >Cc : springframework-developer >Objet : Re:[Springframework-developer] Locale in rowmap? > >Is simply the MappingSqlQueryWithParameters for me? > >Jean-Pierre > >---------- Initial Header ----------- > >>From : spr...@li... >To : spr...@li... >Cc : >Date : Wed, 9 Jul 2003 19:12:24 +0200 >Subject : [Springframework-developer] Locale in rowmap? > >Hi everyone, > >I have a remaining issue with the JDBC package. When 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. > >I see two approachs: > >1) create an object having data for all supported languages. >2) knowing the user Locale, pick from the database only the Locale >matched data. > >The approach 1 will have a performance drawback as all objects contain >unused data. The bean getters must also have a Locale parameter. In >views, it will be a nightmare. > >The approach 2 seems to me far better. But in the rowmap method, 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 MappingSqlQuery >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 >is not a good long term solution due to the performance impact. > >What could be very cool in this situation is an execute method taking a >Locale parameter, just to pass on the rowmap method. > >It would be, as I see, only a matter of adding signatures on the >'execute' and 'rowmap' methods for having ones with Locale transport. > >What is your feel about this? Could I go for these adds? Has anyone a >better solution to propose? > >Regards, >Jean-Pierre > > >********** L'ADSL A 20 EUR/MOIS********** >Tiscali propose l'ADSL le moins cher du marché : 20 EUR/mois et le modem >ADSL offert ! >Pour profiter de cette offre exceptionnelle, cliquez ici : >http://register.tiscali.fr/adsl/ >Offre soumise à conditions. > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Parasoft >Error proof Web apps, automate testing & more. >Download & eval WebKing and get a free book. >www.parasoft.com/bulletproofapps >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > >********** L'ADSL A 20 EUR/MOIS********** >Tiscali propose l'ADSL le moins cher du marché : 20 EUR/mois et le modem >ADSL offert ! >Pour profiter de cette offre exceptionnelle, cliquez ici : >http://register.tiscali.fr/adsl/ >Offre soumise à conditions. > > > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Parasoft >Error proof Web apps, automate testing & more. >Download & eval WebKing and get a free book. >www.parasoft.com/bulletproofapps >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > |