I do not know if there is a standard answer to this, but I would simply say that you can write a bean in such a way that it looks for a descriptor file, and if it finds one, it uses it to populate itself.How does a bean know to load its properties from the descriptor?
Again, this is a design choice. Probably the easiest solution is to simply have the descriptor file reside on the CLASSPATH. But you could certainly have it reside in a directory that is on the CLASSPATH (the next easiest solution), or in a specific directory on the system (not a very portable solution).Do descriptor files reside in certain directory locations by default?
Originally posted by Benjamin Weaver:
What must be done by the developer? What ought best to be done by the existing framework(s)?
...
But my real question is, who should implement the property loading functionality? I, the developer, or some helper class in the Java framework?
...
In the case of javabeans, you are saying, are you not, that I should implement my own strategy of loading properties. You are saying that there are no Java classes (BeanDescriptor, PropertyDescriptor, BeanInfo, open sources commons framework classes) that already do this.
...
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |