On Mon, 2001-12-31 at 15:45, Chuck Esterbrook wrote:
> > * lots of changes to existing servlet code !!! though a conversion
> > tool could ease migration
>
> I feel obligated that the project provide a conversion tool with the
> release that uses the properties style. I have 2 juicy projects I can
> test such a tool on and I'm sure there are others who would be willing
> to help with testing that.
My thoughts on converting: do it the easy way, change Servlet,
HTTPServlet, and Page to use properties. Then create LegacyServlet,
LegacyHTTPServlet, and LegacyPage -- and any others (LegacyTransaction,
I suppose) -- that act like the old classes. The conversion tool will
simply replace these modified classes with the new classes.
Perhaps the classes should have the version number in them, like
LegacyServlet06 (from version 0.6). Since on the first run, maybe
Response and Request get converted, but not Transaction. So the person
has some things from the old, 0.6 behavior, and some servlets written
for 0.7. Then you do Transaction, and you have to leave LegacyServlet07
alone, and change Servlet to LegacyServlet07... I'm not sure.
I'm not sure how to keep those legacy classes up to date, though -- they
could become a pain. Especially since code like:
def request(self):
return self._request
def setRequest(self, req):
self._request = req
Should become simple attribute access, which is fastest. However,
LegacyTransaction would have to wrap this new Transaction, not just
subclass it or something... though maybe with the clever use of
__dict__... or maybe LegacyTransaction could be generated by simply
giving it a list of attributes to wrap, and the getters and setters for
those attributes could be generated.
Smarter automatic conversion tools seem difficult and probably not
robust. An editor with search and replace will do most of the work,
with programmer oversight which will probably be necessary in any case.
The only annoying part is that the translation x.setY(z) to x.y = z is
hard to do in an editor. It can't be done just with regexes, though, as
it has to understand nested expressions.
Ian
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss