|
From: Colin S. <col...@ex...> - 2003-10-15 19:17:56
|
Has an expression language available for use in the app context ever been considered? (as per email below) -------- Original Message -------- Subject: Re: Spring XMLBeanFactory Date: Wed, 15 Oct 2003 15:14:42 -0400 From: Colin Sampaleanu <col...@ex...> To: Vladimir Blagojevic <vla...@cs...> References: <Pin...@bl...> It can't do this (to the best of my knowledge). There is an expression language available for use in the JSP tags, but this is not accessible in the contexts. If there is enough of a use case for this it could certainly be done. One way would be to try leveraging the existing expression language code. I have no idea how easy this would be to do since I've actually never touched the web ui code. Another mechanism would be to bring in something like OGNL, which is quite powerful... What is your usage scenario? Vladimir Blagojevic wrote: >Colin, > >Does XMLBeanFactory support reading property of bean X and assigning it >to bean Y within declarative xml config file? I don't think so, but is >there any chatter on the lists about that? > >Cheers > > > |
|
From: Peter d. H. <pe...@de...> - 2003-10-17 09:46:59
|
A richer expression language would have its use cases. The right thing to do might be to make the language pluggable :^) A little while ago I rolled a simple generic Validator implementation -- configured using the Spring configuration file -- using JEX (http://www.plotnix.com/jex/). This a little pluggable expression language framework. I added JEX plugins for regexps and the JSTL expression language so I could use these (in addition to JavaScript, BEXL and JXPath) to formulate validation rules. I never fed this back to the list because the implementation is not quite generic enough (eg there's no i18n support), but having used it for a while it seems there's a fair bit of mileage in the idea. A decent expression language is IMHO exactly what's missing from the brilliant-idea-but-flawed-execution Struts Validator. In any case, I can think of a number of reasons why it might be good to adopt JEX or a Spring equivalent of it. On a not entirely unrelated note, one of the things I've been missing from Spring is what you might call "anonymous beans". In some situations, I don't really want to pollute the namespace with beans that will only ever be used in one place: <bean id="foo" class="eg.Foo"> <property name="bar"><ref bean="bar"/></property> </bean> <bean id="bar" class="eg.Bar"/> But would like to be able to write something like <bean id="foo" class="eg.Foo"> <property name="bar"><bean class="eg.Bar"/></property> </bean> Has this been discussed before? Spring is the best thing I've come across for a while and I'd love to contribute something back :^) - Peter ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <spr...@li...> Sent: Wednesday, October 15, 2003 8:17 PM Subject: [lists] [Springframework-developer] Expression language for use in ApplicationContext > Has an expression language available for use in the app context ever > been considered? (as per email below) > > -------- Original Message -------- > Subject: Re: Spring XMLBeanFactory > Date: Wed, 15 Oct 2003 15:14:42 -0400 > From: Colin Sampaleanu <col...@ex...> > To: Vladimir Blagojevic <vla...@cs...> > References: <Pin...@bl...> > > > > It can't do this (to the best of my knowledge). There is an expression > language available for use in the JSP tags, but this is not accessible > in the contexts. > > If there is enough of a use case for this it could certainly be done. > One way would be to try leveraging the existing expression language > code. I have no idea how easy this would be to do since I've actually > never touched the web ui code. Another mechanism would be to bring in > something like OGNL, which is quite powerful... > > What is your usage scenario? > > > Vladimir Blagojevic wrote: > > >Colin, > > > >Does XMLBeanFactory support reading property of bean X and assigning it > >to bean Y within declarative xml config file? I don't think so, but is > >there any chatter on the lists about that? > > > >Cheers > > > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Rod J. <rod...@in...> - 2003-10-17 09:58:45
|
Peter, > A richer expression language would have its use cases. The right thing to do > might be to make the language pluggable :^) Yes, it could certainly be powerful. It has crossed my mind from time to time (except I didn't think of pluggability), but I was a bit concerned that the whole thing might get complex. However, I think it may be worthwhile. > On a not entirely unrelated note, one of the things I've been missing from > Spring is what you might call "anonymous beans". In some situations, I don't > really want to pollute the namespace with beans that will only ever be used > in one place: > > <bean id="foo" class="eg.Foo"> > <property name="bar"><ref bean="bar"/></property> > </bean> > > <bean id="bar" class="eg.Bar"/> > > But would like to be able to write something like > > <bean id="foo" class="eg.Foo"> > <property name="bar"><bean class="eg.Bar"/></property> > </bean> > > Has this been discussed before? I don't think it's been discussed on the list, but I've considered the idea of reducing bean visibility. Nesting this way would be one way to do it (although it might involve substantial refactoring). Another way I've considered is the notion of "protected" and/or "private" beans, that can't be accessed outside that factory, but can be used in references. Certainly I think agree in some cases it would be good to avoid filling the namespace with single-use beans. What do others think? I suspect that this is a 1.1 thing, as I think we need to focus on existing functionality for 1.0. But it's a good suggestion nonetheless. > Spring is the best thing I've come across for a while and I'd love to > contribute something back :^) Thanks. Regards, Rod |
|
From: Colin S. <col...@ex...> - 2003-10-17 17:46:27
|
Rod Johnson wrote: >Peter, > >> richer expression language would have its use cases. The right thing to >> >> >do > > >>might be to make the language pluggable :^) >> >> > >Yes, it could certainly be powerful. It has crossed my mind from time to >time (except I didn't think of pluggability), but I was a bit concerned that >the whole thing might get complex. However, I think it may be worthwhile. > > I've used OGNL with Tapestry, and I find it quite useful and powerful. I know WebWork2 also uses it now. While pluggability isn't a bad idea, I would be happy even with just OGNL... W/regards to the complexity aspect, where do you see issues? One area that's a bit grey relates to the lifecycles of the other beans... > > >>On a not entirely unrelated note, one of the things I've been missing from >>Spring is what you might call "anonymous beans". In some situations, I >> >> >don't > > >>really want to pollute the namespace with beans that will only ever be >> >> >used > > >>in one place: >> >> <bean id="foo" class="eg.Foo"> >> <property name="bar"><ref bean="bar"/></property> >> </bean> >> >> <bean id="bar" class="eg.Bar"/> >> >>But would like to be able to write something like >> >> <bean id="foo" class="eg.Foo"> >> <property name="bar"><bean class="eg.Bar"/></property> >> </bean> >> >>Has this been discussed before? >> >> > >I don't think it's been discussed on the list, but I've considered the idea >of reducing bean visibility. Nesting this way would be one way to do it >(although it might involve substantial refactoring). Another way I've >considered is the notion of "protected" and/or "private" beans, that can't >be accessed outside that factory, but can be used in references. Certainly I >think agree in some cases it would be good to avoid filling the namespace >with single-use beans. > >What do others think? > > Actually just the other day I was wondering why beans couldn't be defined inline like this. I think it's a lot cleaner when you want to do one-off bean definitions... >I suspect that this is a 1.1 thing, as I think we need to focus on existing >functionality for 1.0. But it's a good suggestion nonetheless. > > |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-10-17 10:43:22
|
> A little while ago I rolled a simple generic Validator implementation -- configured using the Spring configuration file -- using JEX (http://www.plotnix.com/jex/). This a little pluggable expression language framework. I added JEX plugins for regexps and the JSTL expression language so I could use these (in addition to JavaScript, BEXL and JXPath) to formulate validation rules. I've never seen JEX before, but it sounds and looks really interesting. Also, I thnk integration of expression language(s) in the context stuff would be great somehow. But these would definitely be 1.1 features. |