| kelly martin ( @ 2006-04-16 15:27:00 |
I had an idea in the shower today, for something that might be useful. But I don't want to reinvent the wheel.
I want something for use in a Tomcat servlet that, given an arbitrary class, will use introspection to examine the servlet request and create a new instance of the class with its nontransient instance variables initialized against properly named form values from the request. Initially, I'm willing to do the introspection at runtime, but it would be best if factory methods can be developed at runtime to generate the instance from the servlet request (perhaps as a constructor?). I know, I could just write them by hand, but that's tedious and increases maintenance.
If someone's already done this, please point me in the right direction. If this is a bad idea, tell me why (and not just because Java is evil/stupid/bad, I don't want a language war).
I want something for use in a Tomcat servlet that, given an arbitrary class, will use introspection to examine the servlet request and create a new instance of the class with its nontransient instance variables initialized against properly named form values from the request. Initially, I'm willing to do the introspection at runtime, but it would be best if factory methods can be developed at runtime to generate the instance from the servlet request (perhaps as a constructor?). I know, I could just write them by hand, but that's tedious and increases maintenance.
If someone's already done this, please point me in the right direction. If this is a bad idea, tell me why (and not just because Java is evil/stupid/bad, I don't want a language war).