[EMAIL PROTECTED] writes:

> Please,
> 
> Forgive me if this topic has been discussed earlier. I'm quite new with
> Turbine and just started more serious work with modules.
> 
> The RunData object is a key object all around Turbine and I think that its
> correct use could be clarified and its internal state better protected by
> making it an interface instead of an object. Now it contains fields that are
> partly public and partly private. In addition, also most public fields have
> both getters and setters. Yet some of the fields are quite clearly meant to
> be initialized only by the factory and should not be changed during
> processing.
> 
> Examples of interfaces used for corresponding purposes are
> HttpServletRequest, HttpServletResponse and HttpSession. An additional
> benefit from the change would be the possibility to make implementations
> support new functionality, e.g. pooling. As Tomcat pools connectors, request
> and response implementations and Turbine caches modules, RunData is one of
> the base objects, which is allocated again for every request. For heavy
> loaded applications, balancing of memory usage is a key issue.
> 
> I tried this by creating a RunData interface, renaming the original RunData
> to TurbineRunData and making all of its fields private. I added pooling
> support both to TurbineRunData and RunDataFactory. Only five classes in
> Turbine (01/31/2001) were referencing the public fields, otherwise
> compilation was OK and running some basic Velocity modules worked without
> problems.
> 
> The classes that required changes were related to error handling (Error,
> VelocityErrorScreen, WebMacroErrorScreen) using the stackTrace and
> stackTraceException fields. I changed the classes to use getters/setters
> instead. In addition, DefaultBottomNavigation used the varDebug field, which
> I also moved behind a getter. The Turbine class was changed to return the
> used RunData back to the factory to be recycled. For pooling support, I
> added a Recyclable interface and a RecyclableSupport class for objects to be
> pooled and a BoundedBuffer class for implementing the pool. 
> 
> The RunData interface is attached and I would be happy to provide the rest,
> if this gets support. Comments?

I have mentioned this before myself.  I am very +1 on this change.
-- 

Daniel Rall <[EMAIL PROTECTED]>


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to