Just a quick thought, I am not completely sure this will work.

In a PullSystem class, you have a method like:

getObject("key", "className", context)
{
  if (context.contains("key"))
        return context.get("key");
  else
  {
     Object o = instantiate "className"
     context.put("key", o);
     return o;
}

Then Actions/Screens call this method to prepare the BO.  They will
either get the one added earlier in the chain or add it if it is not
there yet.

John McNally 


Jon Stevens wrote:
> 
> (Please send responses to the Turbine mailing list.)
> 
> Hi all,
> 
> So, I'm working through implementing the pull model within the Scarab
> application and I have run into a tiny snag.
> 
> Essentially, the issue is that I am using the screen/Default.java to
> populate the Context with my business object(s) (BO). The problem with this
> is that Action's within Turbine are executed before a Screen is executed.
> Therefore, my BO is not available to me in the Action because the Screen
> hasn't been executed first. I want my Action to be able to access this BO
> because it should have the ability to stuff information into it in order to
> do things like re-display data on a page based on information stored in the
> User's temporary storage (ie: User.setTemp()).
> 
> I could probably work around this by finding another place to insert the BO
> earlier on in the chain of execution (maybe in the SessionValidator or Page
> level of the application with a custom Page).
> 
> I could also work with Velocity to make a Context object system that auto
> populates itself, however, I think that this functionality should be
> somewhere within Turbine instead of Velocity because we would want to make
> it generic enough to work in other systems like WebMacro.
> 
> What do you all think that I should do?
> 
> (Please send responses to the Turbine mailing list.)
> 
> -jon
> 
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [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