Not that I want to beat this to death; I really find this interesting
and want to share ideas. Three things...
1. Thread safety -- it's a noble goal with many benefits once you
achieve it. However, no one will be able to achieve it with
typical Webware usage as long as the Page servlet is not
thread-safe. For want of convenience (eg, beging able to call
self.response() instead of self.trans().response()) we have lost
thread-safety. I contend that Webware out-of-the-box should be
thread-safe. I would, however, leave the default value returned
by Servlet.canBeThreaded() false, so the unsuspecting coder
doesn't end up in a mess.
2. I noticed the doc string for Servlet.canBeThreaded() says, "Note:
This is not currently used." Is this true? Why? Surely it must
be easier NOT to create a new instance for each thread.
3. Instance variables vs. Request fields. If one is interested in
thread safety they should use Request fields. If an instance
can't be thread-safe for some reason or a developer doesn't care
if there's a dozen or so instances floating about, then using
instance variables is certainly cleaner code (eg, referencing
self.x instead of trans().request().field('x')) Thoughts?
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss