|
From: Solomon D. <sd...@gm...> - 2007-05-22 19:29:40
|
Ok.. you convinced me :) On 5/22/07, Lachezar Dobrev <l.d...@gm...> wrote: > Actually this might prove very useful. > I have missed this new feature... > For instance the AOP interceptors quite often need to have a specific > ordering. For now my implementation is so: > > <bean name="baseService" ...> > <property name="interceptors"> > <list> > <value>transactionInterceptor</value> > <value>hibernateInterceptor</value> > </list> > </property> > </bean> > > <bean name="someService" parent="baseService"> > <property name="interceptors"> > <list> > <value>validationInterceptor</value> > <value>transactionInterceptor</value> > <value>hibernateInterceptor</value> > </list> > </property> > </bean> > > So I rewrite the whole list to prepend an item. > > It would possibly prove useful to have: > ... > <list merge="prepend"> > <value>transactionInterceptor</value> > </list> > ... > > And this would be also backward-compatible (true, prepend or append). > > Your style is viable (no doubt about that), but I think is more tedious, > and I have trouble understanding it. > > 2007/5/22, Solomon Duskis < sd...@gm...>: > > > > The current "merge" functionality is slick because it is easy to use. > > More functionality may end up making the merge functionality harder to > > understand. > > > > I needed something more powerful as well. I wrote my own > > ListFactoryBean that is as configurable as you'd like. You can see > > what I did at > http://jroller.com/page/Solomon?entry=appending_lists_in_spring_xml > > > > Basically, you'll need to break out the parent & child lists into > > separate configurations and the use a "ref" instead of a nested > > <list>. > > > > For example instead of doing: > > > > ... parent > > <property name="myList"> > > <list> > > <value>3</value> > > <value>4</value> > > </list> > > </property> > > > > ... child > > <property name="myList" merge="true"> > > <list> > > <value>1</value> > > <value>2</value> > > </list> > > </property> > > > > You would do the following instead: > > > > ... parent > > <property name="myList" ref="parent_list"> > > </bean> > > > > <util:list name="parent_list"> > > <list> > > <value>3</value> > > <value>4</value> > > </list> > > </util:list> > > > > <bean class="...MyListFactoryBean" name="child_list"> > > <property name="list"> > > <list> > > <value>1</value> > > <value>2</value> > > <ref local="parent_list"> > > </list> > > </property> > > </util:list> > > > > ... child > > <property name="myList" ref="child_list"> > > > > I hope that this helps... > > > > -Solomon > > > > On 5/22/07, Rob Butler < cro...@ya...> wrote: > > > Hello all, > > > > > > In Spring 2.0 the capability to merge parent & child lists was added. > This is a great feature, but unfortunately the current implementation will > always place elements in the parent list before elements in the child list. > It would be nice if an additional parameter could be added to control > whether the parent or child list elements are first in the merged list. In > an application I am currently developing merged lists would have been ideal, > but I need the child elements to come first so the current implementation > cannot be used. > > > > > > Thanks > > > Rob > > > > > > > > > > > > > > > > > > > ____________________________________________________________________________________Yahoo! > oneSearch: Finally, mobile search > > > that gives answers, not web links. > > > > http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by DB2 Express > > > Download DB2 Express C - the FREE version of DB2 express and take > > > control of your XML. No limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > _______________________________________________ > > > Springframework-developer mailing list > > > Spr...@li... > > > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |