Here's a diff for the changes we've been discussing.  Basically it's the
same as the diffs that Chris submitted with a few changes:

- renamed Assemblers to Assembler
- all classes that extend Assembler are abstract to force people to extend
it
- build(), doBuild(), perform(), doPerform() are protected to force people
to use the Loaders to execute a  given module
- doBuild() and doPerform() are abstract to force subclasses to implement
them

I've tested these changes by changing all methods to doBuild() and
doPerform() in Turbine and it works fine.

I'd like to standardize build() and doBuild() before we roll a 1.0 instead
of using names like buildScreen() and doBuildScreen().  Of course this means
that people currently using Turbine will have to change all their methods to
doBuild() and doPerform() but I'm willing to do that for the apps I'm
working on.

Let me know if I missed anything.

Thoughts?



/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/Action.jav
a,v
retrieving revision 1.3
diff -r1.3 Action.java
62c62
< public abstract class Action extends Assemblers
---
> public abstract class Action extends Assembler
64c64,84
<     public abstract void build( RunData data ) throws Exception;
---
>     /*
>      * Implementors override this method to perform their action.
>      *
>      * The action can also set the screen that is associated with the
>      * data object.
>      */
>     protected abstract void doPerform( RunData data ) throws Exception;
>
>     /*
>      * Clients call this to perform the action associated with this
object.
>      *
>      * This is the public method that clients of this class can call. This
>      * performs the action by invoking the doPerform() method. Clients
>      * should typically override the doPerform() method in order to
implement
>      * specific actions.
>      */
>     protected void perform( RunData data ) throws Exception
>     {
>         doPerform( data );
>     }
>
Index: ActionLoader.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/ActionLoad
er.java,v
retrieving revision 1.6
diff -r1.6 ActionLoader.java
111c111
<         getInstance(name).build(data);
---
>         getInstance(name).perform(data);
Index: Layout.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/Layout.jav
a,v
retrieving revision 1.2
diff -r1.2 Layout.java
65c65
< public abstract class Layout extends Assemblers
---
> public abstract class Layout extends Assembler
67c67,86
<     public abstract void build( RunData data ) throws Exception;
---
>     /*
>      * Override this method to implement a layout builder.
>      *
>      * Implementors override this method to store the layout in the data
>      * object, or to stream the layout out to the output stream in the
data
>      * object.
>      */
>     protected abstract void doBuild( RunData data ) throws Exception;
>
>     /*
>      * Call this method to build the layout.
>      *
>      * Clients call this method to store the layout into the data object,
>      * or to stream the layout out to the output stream in the data
object.
>      */
>     protected void build( RunData data ) throws Exception
>     {
>         doBuild( data );
>     }
>
Index: Navigation.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/Navigation
.java,v
retrieving revision 1.6
diff -r1.6 Navigation.java
69c69
< public abstract class Navigation extends Assemblers
---
> public abstract class Navigation extends Assembler
73c73,94
<     public abstract ConcreteElement build( RunData data ) throws
Exception;
---
>     /*
>      * Override this method to implement navigation component building.
>      *
>      * Implementors override this method to build the ConcreteElement
>      * representing their navigation component, store the navigation
>      * component in the data object, or to stream the navigation component
>      * out to the output stream in the data object.
>      */
>     protected abstract ConcreteElement doBuild( RunData data ) throws
Exception;
>
>     /*
>      * Call this method to build the navigation component.
>      *
>      * Clients call this method to return a concrete element representing
>      * the navigation component, store the navigation component into the
data
>      * object, or to stream the navigation component out to the output
stream
>      * in the data object.
>      */
>     public ConcreteElement build( RunData data ) throws Exception
>     {
>         return doBuild( data );
>     }
Index: Page.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/Page.java,
v
retrieving revision 1.2
diff -r1.2 Page.java
65c65
< public abstract class Page extends Assemblers
---
> public abstract class Page extends Assembler
67c67,86
<     public abstract void build( RunData data ) throws Exception;
---
>     /*
>      * Override this method to implement a page builder.
>      *
>      * Implementors override this method to store the page in the data
>      * object, or to stream the page out to the output stream in the data
>      * object.
>      */
>     protected abstract void doBuild( RunData data ) throws Exception;
>
>     /*
>      * Call this method to build the page.
>      *
>      * Clients call this method to store the page into the data object,
>      * or to stream the page out to the output stream in the data object.
>      */
>     protected void build( RunData data ) throws Exception
>     {
>         doBuild( data );
>     }
>
Index: ScheduledJob.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/ScheduledJ
ob.java,v
retrieving revision 1.2
diff -r1.2 ScheduledJob.java
76c76
< public abstract class ScheduledJob extends Assemblers
---
> public abstract class ScheduledJob extends Assembler
Index: Screen.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/Screen.jav
a,v
retrieving revision 1.7
diff -r1.7 Screen.java
69c69
< public abstract class Screen extends Assemblers
---
> public abstract class Screen extends Assembler
74c74,95
<     public abstract ConcreteElement build( RunData data ) throws
Exception;
---
>     /*
>      * Override this method to implement screen building.
>      *
>      * Implementors override this method to build the ConcreteElement
>      * representing their screen, store the screen in the data object,
>      * or to stream the screen out to the output stream in the data
>      * object.
>      */
>     protected abstract ConcreteElement doBuild( RunData data ) throws
Exception;
>
>     /*
>      * Call this method to build the screen.
>      *
>      * Clients call this method to return a concrete element representing
>      * the screen, store the screen into the data object, or to stream the
>      * screen out to the output stream in the data object.
>      */
>     protected ConcreteElement build( RunData data ) throws Exception
>     {
>         return doBuild( data );
>     }
>


RCS file: /products/cvs/turbine/turbine/src/java/Turbine.java,v
retrieving revision 1.52
diff -r1.52 Turbine.java
277c277,278
<             sessionValidator.build( data );
---
>             ActionLoader.getInstance()
>                 .exec( data,
TurbineResources.getString("action.sessionvalidator") );



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to