|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-07-09 17:19:44
|
Is simply the MappingSqlQueryWithParameters for me?=0D=0A=0D=0AJean-Pierr= e=0D=0A=0D=0A---------- Initial Header -----------=0D=0A=0D=0AFrom := spr...@li...=0D=0ATo := spr...@li...=0D=0ACc : =0D=0A= Date : Wed, 9 Jul 2003 19:12:24 +0200=0D=0ASubject : [Springframewo= rk-developer] Locale in rowmap?=0D=0A=0D=0AHi everyone,=0D=0A=0D=0AI 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-o= bjects 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=0A= 2) knowing the user Locale, pick from the database only the Locale matche= d data.=0D=0A=0D=0AThe approach 1 will have a performance drawback as all= objects contain unused data. The bean getters must also have a Locale pa= rameter. In views, it will be a nightmare.=0D=0A=0D=0AThe approach 2 seem= s to me far better. But in the rowmap method, the User Locale has to be k= nown 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 Local= e class property and call execute with its others arguments. The method m= ust be synchronized to be threadsafe as I use a class variable. This work= s, but I guess synchronizing the request is not a good long term solution= due to the performance impact.=0D=0A=0D=0AWhat could be very cool in th= is situation is an execute method taking a Locale parameter, just to pass= on the rowmap method.=0D=0A=0D=0AIt would be, as I see, only a matter of= adding signatures on the 'execute' and 'rowmap' methods for having ones = with Locale transport.=0D=0A=0D=0AWhat is your feel about this? Could I g= o for these adds? Has anyone a better solution to propose?=0D=0A=0D=0AReg= ards,=0D=0AJean-Pierre=0D=0A=0D=0A=0D=0A********** L'ADSL A 20 EUR/MOIS**= ********=0D=0ATiscali propose l'ADSL le moins cher du march=E9 : 20 EUR/m= ois et le modem ADSL offert ! =0D=0APour profiter de cette offre exceptio= nnelle, cliquez ici : http://register.tiscali.fr/adsl/=0D=0AOffre soumise= =E0 conditions.=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A---------------------------= ----------------------------=0D=0AThis SF.Net email sponsored by: Parasof= t=0D=0AError proof Web apps, automate testing & more.=0D=0ADownload & eva= l WebKing and get a free book.=0D=0Awww.parasoft.com/bulletproofapps=0D=0A= _______________________________________________=0D=0ASpringframework-deve= loper mailing lis...@li...=0D= =0Ahttps://lists.sourceforge.net/lists/listinfo/springframework-developer= =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 ! =0A= Pour profiter de cette offre exceptionnelle, cliquez ici : http://registe= r.tiscali.fr/adsl/=0AOffre soumise =E0 conditions.=0A |
|
From: JP P. <jp....@ti...> - 2003-07-09 21:33:40
|
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=A0: springframework-developer Objet=A0: Re:[Springframework-developer] Locale in rowmap? Is simply the MappingSqlQueryWithParameters for me? Jean-Pierre ---------- Initial Header ----------- From : spr...@li... To : spr...@li... Cc :=20 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=E9 : 20 EUR/mois et le = modem ADSL offert !=20 Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/ Offre soumise =E0 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=E9 : 20 EUR/mois et le = modem ADSL offert !=20 Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/ Offre soumise =E0 conditions. |
|
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 > > > > |
|
From: <tri...@tr...> - 2003-07-10 14:31:23
|
Ken, JP, I would agree with Ken here - we must avoid any dependencies between the JDBC framework and the Web framework. There must be a better way of solving this. Why can't you just pass in the locale as a regular parameter in a where clause for a SQLQuery? Thomas > 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 > > > > > > > > > > > > > ------------------------------------------------------- > 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 > |
|
From: Rod J. <rod...@in...> - 2003-07-10 17:05:59
|
> I would agree with Ken here - we must avoid any dependencies between the JDBC > framework and the Web framework. +1. I know of several companies in the UK using JDBC only at this point. It's a great route in for Spring. |
|
From: William G. T. Jr. <wg...@ru...> - 2003-07-11 17:31:23
|
Rod Johnson wrote: >>I would agree with Ken here - we must avoid any dependencies between the > > JDBC > >>framework and the Web framework. > > > +1. I know of several companies in the UK using JDBC only at this point. > It's a great route in for Spring. +1. To keep JDBC framework seperate. Rutgers is using the JDBC framework in conjuntion with our uPortal project. Bill |