PDA

View Full Version : SWF Architecture question 1 - Singleton



yfmoan
May 11th, 2005, 12:15 AM
Hi ,
l would like to ask an architecture question.
l saw http://www.theserverside.com/news/thread.tss?thread_id=33787 , a person ask about support for webwork.

If SWF integrated with Webwork , it has to make all the Actions a prototype , because of the design of Webwork. l learn Webwork recently and found that Webwork actions have state ( means they store data in properties/fields of the Controllers , then use a demon - ValueStack to pull and push the data out of the Controllers ) . Because it have state , this make them have to be prototypes if u wanna to reuse them.

Form my previous post in other thread http://forum.springframework.org/viewtopic.php?t=4342&highlight= , l don't understand why controllers has to be a prototype to get reuse. I like SWF very much because it let me to reuse the same singleton controller many time in a flow ( this won't cause synchronize problem , because it is in a flow )

Do your think that Controllers need states all the time ?
If SWF and Webwork integrate this way , it will reduce reusability of the Controllers .

moon

Keith Donald
May 11th, 2005, 07:30 AM
Well, we're certainly not going to change our Action model, where an action is more like a command than a MVC controller :-)

You bring up a good point, though. Since in WW the actions are the model AND the controller, integration with SWF might be a bit different. I wonder if its possible to still have one generic WW action class act as a entry point for one or more web flows, but act in a prototype fashion.

klr8
May 23rd, 2005, 03:15 PM
Actually, a statefull WW controller might map nicely to a SWF FlowExecutionManager. No need to go and store the state of an ongoing flow execution in the session, just store it inside the statefull controller.

We'll have to see how that turns out once somebody tries WW integration.

Erwin