|
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. > > |