|
From: Colin S. <col...@ex...> - 2004-10-07 18:13:56
|
A relevant point, and there's no way to catch this at edit time via the DTD, only at runtime via Spring itself (well, that's not quite true, as I've been meaning for ages to create an ant task that does a basic validation of a Spring config file, similar to what is in the Spring-IDE eclipse plugin). Still, probably worth it... Winter Andreas wrote: >Be aware you must then check for constructs like > ><property name="user" bean="aBean"><value>admin</value></property> > >Anyway it's a good idea. > >Having introduced Spring in our projects, I was faced with complains about >writing nearly the same configuration over and over again, e.g. applying an >interceptor to many beans or setting a session factory into many DAOs. Child >beans solve some problems but there should be a more explicit mechanism not >a reuse of the <bean> tag. > >- Andreas > > > > >>-----Original Message----- >>From: jürgen höller [werk3AT] [mailto:jue...@we...] >>Sent: Thursday, October 07, 2004 3:09 PM >>To: spr...@li... >>Subject: [Springframework-developer] Simplify typical xml setup syntax >> >> >>Another request to simply <property> usage in XML bean definitions: >> >> http://opensource.atlassian.com/projects/spring/browse/SPR-379 >> >>This time, it's not about considering CDATA inside >><property>...</property> as value, but rather about further >>attributes for the <property> tag itself: >> >> <property name="user" value="admin"/> >> <property name="linkFormatter" bean="linkFormatter"/> >> >>I'd probably name the bean reference attributes differently, >>i.e. "ref-bean" respectively "ref-local". But the general >>idea is not bad - it's cleaner than the CDATA-as-value >>suggestion, I guess. >> >>Let's compare the currently necessary markup: >> >> <property name="user"><value>admin</value></property> >> <property name="linkFormatter"><ref >>bean="linkFormatter"/></property> >> >>Which is clearly more verbose, even if not too much. The main >>advantage of the attribute version is that it avoids closing >>tags completely. >> >>Thoughts? >> >>Juergen >> >> |