|
From: Colin S. <col...@ex...> - 2003-11-20 23:32:23
|
I keep on running into the case where in defining a bean in a bean factory or context, I need to set a property to the value of a property from another bean, not the bean itself. How are people typically handling this limitation? For that matter, it would be very useful to be able to get a bean into the container via an expression. I am for example using the CCPP processing API from Sun. All the classes use a factory to get a bean instance. So if I need a ProfileFactory, I get one with this code, calling a static method: ProfileFactory pf = ProfileFactoryImpl.getInstance(); I have some beans in a context which need this passed in. I would handle this right now by defining a new class which is a FactoryBean, and returns the result of the above, but that's kludgy. Now handling any kind of generic code of this sort needs an expression evaluator, but I think this particular idiom (a static method call on a class) could probably be handled in a simpler fashion, built-in? What do you guys think? |