Hi guys! I too have had some of the smae questions. I have not been able to find any answers on this though. I have just decided to use my best judgement here (which may not be very good...). I figured that I would make my view helpers more of an interface for the architecture to interact with my views. That means the view helpers only exposed functionality that my commands or any other view helpers would use. Any logic the view needed to perform within the view itself, I left in the view. I know it is not extremely clean, but in some situations, I have not found a better way. Just my two cents. Hope that helped.
--- In [email protected], "Mehdi, Agha" <[EMAIL PROTECTED]> wrote: > Hi Dave, > > I am going through the same need to find out the best way to make better use > of views and view helpers. I will submit my ideas to this list and wait for > Gurus to correct me. > > I think a view should just be an unintelligent part of the presentation > layer and all of its functionality should be encapsulated in a view helper. > This way that view helper can be made available to different commands or a > global Validation Class (I don't like it though). Now if multiple views > share the same variables for validation, it makes it easy for > commands/Validation_Class to validate forms and make business decisions. > > The confusion is that if we want to implement commands to validate forms > then for every single validation, we need to have a separate command, which > I'm not sure is a bad idea if we have a validation controller and it > registers all the validation commands. This way make the validation > commands just a means of sending the request to the view helpers to process > the functionality of any view. If we don't use commands for validation and > have a Global Validation Class then it gets messy (I think) with having to > write validation functions for the entire application. > > > In short, I don't know the best way. I am just hoping that someone will see > this and yell at me in disagreement. > > > -----Original Message----- > From: dave buhler [mailto:[EMAIL PROTECTED] > Sent: Friday, January 21, 2005 11:08 PM > To: [email protected] > Subject: [flexcoders] Cairngorm ViewHelpers and Views and Commands > > > Hello, > > Okay, I'm looking for some general guidance before I have to dust- off the > Gang of Four book (again) and pray I don't fall asleep four-pages into it. > > We have the Cairngorm framework in place and the application is working. The > delegates we've left in the delegate classes, the functions for the > viewhelpers still reside in their respective view helpers. The commands are > pretty much the same. > > The problem lies with the views. There are a growing number of functions in > each view. > > 1) Should the views be nothing more than the forms? Where does the > validation go? I would assume I can keep the models and validation along > with the mxml. Where would a keylistener go for a specfic view? > In the view or in the viewHelper? > > 2) Some variables and conditions, I can't conceptualize how they would work > without a _global scope (or _root). Is anyone building an app that can carry > an application-scope reference without using either one? if so, what are you > doing that I'm not? I figure path-wise, I could set some scope using a > namespace that references the application.mxml file, but I'm just guessing. > What's the approach for writing conditional logic based on a shared variable > when two functions, in different views are referencing some shared > condition? > > 3) Looking this project over, I can see some event.targets that are > identical in their use. Click a listbox, send the delegate out, have it > peform some purpose. Each view has its own. Isn't there a way to just > reference the event.targets in a _global sense so we can use the same > wrapped function over and over and over and just pass it the viewname as the > delegate or pass it the delegate name as event.data within a component's > click="function()" handler? > > Dave > > > > Yahoo! Groups Links > > > > > > > > > ---- > This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. > > To reply to our email administrator directly, send an email to > [EMAIL PROTECTED] > > Littler Mendelson, P.C. > http://www.littler.com

