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