[flexcoders] Re: Cairngorm: Managing Popup Windows
Very true words Stefan - cheers! The Command/ModelLocator approach you described sounds logical to me -although at first sight it seems to overcomplicate the rather simple task of updating "model.selectedUser" and opening a popup window. -TH--- In flexcoders@yahoogroups.com, "Stefan Schmalhaus" <[EMAIL PROTECTED]> wrote:>> Tim,> > No worries about the spelling of my name. ;-)> > Thank you very much for your explanations. Once you are experienced> enough, you can value the beauty and FLEXibility of a software> development concept/tool. I'm still at the beginning of my learning> curve, and sometimes the complexity of Flex/Cairngorm overwhelmes me. > > In the past, when I developed smaller apps with Flash/AS2 I very often> found myself in a dead-end situation when clients asked for additional> features, etc. I'm familiar with some basic design patterns but I've> always missed a consistent framework for AS2. > > Cairngorm was really an eye-opener for me because now I have the> feeling that there's a powerful concept that helps me to develop> scalable applications. Since the use of popup windows is quite common,> I expected something like a "standard procedure" for Flex/Cairngorm.> I'm afraid to find myself in a dead-end situation again if I do it> "the wrong way". > > The Command/ModelLocator approach you described sounds logical to me -> although at first sight it seems to overcomplicate the rather simple> task of updating "model.selectedUser" and opening a popup window. But> I guess it will make the application more consistent once it grows and> more and more functionality is added.> > Thanks again.> > Stefan> __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
[flexcoders] Re: Cairngorm: Managing Popup Windows
Tim, No worries about the spelling of my name. ;-) Thank you very much for your explanations. Once you are experienced enough, you can value the beauty and FLEXibility of a software development concept/tool. I'm still at the beginning of my learning curve, and sometimes the complexity of Flex/Cairngorm overwhelmes me. In the past, when I developed smaller apps with Flash/AS2 I very often found myself in a dead-end situation when clients asked for additional features, etc. I'm familiar with some basic design patterns but I've always missed a consistent framework for AS2. Cairngorm was really an eye-opener for me because now I have the feeling that there's a powerful concept that helps me to develop scalable applications. Since the use of popup windows is quite common, I expected something like a "standard procedure" for Flex/Cairngorm. I'm afraid to find myself in a dead-end situation again if I do it "the wrong way". The Command/ModelLocator approach you described sounds logical to me - although at first sight it seems to overcomplicate the rather simple task of updating "model.selectedUser" and opening a popup window. But I guess it will make the application more consistent once it grows and more and more functionality is added. Thanks again. Stefan -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Cairngorm: Managing Popup Windows
Sorry, my bad English. Should be Stefan. -TH --- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote: > > Hi Stephan, > > Don't worry about good/bad English here, communication is the key. > The beauty of Cairngorm and Flex is that you can accomplish the same > thing several ways. Chances are that your edit/delete form is a > view also. So you can either change view state (ModelLocator) to > add the view child, or create a PopUp with the view as the child. > Either way works, but PopUps add a level of event processing that > can be tricky. > > To answer your question, the Cairngorm pundits would recommend that > the DataGrid's selected event should trigger a Command that updates > a ModelLocator state variable, and selected item, to display the > form. That's one way. Or you can launch a PopUp from the command > itself. > > Another approach is to not worry about the view knowing about the > model. I mean it's bound one way, why not the other. Every bound > view knows about the ModelLocator. So it makes sense, since a view > has a hard coded variable name for state, that you can also directly > change a ModelLocator variable from the view. Total encapsulation > or limited encapsulation? > > Just make sure that you keep the data in the model. What you choose > beyond that is apparently up to you. I personally like the PopUp > approach. From the view, it's quicker and valid for local > processing. But, the Command/ModelLocator approach is considered > more stable .02 > > -TH > > --- In flexcoders@yahoogroups.com, "Stefan Schmalhaus" > wrote: > > > > I've done some research on this list but haven't found any valid > > information on what's considered best pratice in dealing with popup > > windows. The few Cairngorm sample apps that are around don't seem > to > > use the TitleWindow component at all. > > > > Let's say I have a simple DataGrid populated with some user data. > If I > > click on a row in the DataGrid a popup window opens with a form for > > editing the user information. The popup window also has two buttons > > for deleting or saving (updating) the user account. > > > > I have done stuff like this several times in Flash/AS2 but I've > never > > used a framework approach so far. Now, if I look at this rather > simple > > task from a Cairngorm perspective it doesn't seem to be that simple > > any more. (But I guess that's because I'm not yet too familiar with > > Cairngorm.) I know how to establish databinding between the data > > provider and {model.users} and all this basic Cairngorm stuff. > > > > But what happens when a row is clicked? I'm not even sure if I'm > > supposed to treat this event as a single event ("selectUser" or > > "openPopup"?) or as a chain of two events ("selectUser" -> > > "openPopup"). Since my user information is organized as an array of > > value objects it's easy to assign the selected user VO to > > model.selectedUser: > > > > model.selectedUser = UserVO(userList.selectedItem); > > > > But am I "allowed" to directly access the ModelLocator from my view > > component? Or am I supposed to route this simple action through the > > Cairngorm "command chain" (Cairngorm Event -> Front Controller -> > > Command Class -> ModelLocator)? > > > > Next question, what about the popup itself? Can I simply use > > PopUpManager.createPopUp( this, UserFormView , true)? Or am I > supposed > > to treat this as a Cairngorm Event, too? > > > > I feel in "safe Cairngorm terrain" again with the "updateUser" and > > "deleteUser" actions on the buttons. But what about closing the > popup > > window? Is this even worth a Cairngorm event? > > > > I guess these questions sound rather stupid to those of you who are > > more experienced with frameworks. But at the moment these questions > > are obstacles on my way to master Cairngorm (which I will > hopefully do > > one day). I apologize for my verbose post and my bad English, but I > > hope that someone can shed some light on these issues. > > > > Stefan > > > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Cairngorm: Managing Popup Windows
Hi Stephan, Don't worry about good/bad English here, communication is the key. The beauty of Cairngorm and Flex is that you can accomplish the same thing several ways. Chances are that your edit/delete form is a view also. So you can either change view state (ModelLocator) to add the view child, or create a PopUp with the view as the child. Either way works, but PopUps add a level of event processing that can be tricky. To answer your question, the Cairngorm pundits would recommend that the DataGrid's selected event should trigger a Command that updates a ModelLocator state variable, and selected item, to display the form. That's one way. Or you can launch a PopUp from the command itself. Another approach is to not worry about the view knowing about the model. I mean it's bound one way, why not the other. Every bound view knows about the ModelLocator. So it makes sense, since a view has a hard coded variable name for state, that you can also directly change a ModelLocator variable from the view. Total encapsulation or limited encapsulation? Just make sure that you keep the data in the model. What you choose beyond that is apparently up to you. I personally like the PopUp approach. From the view, it's quicker and valid for local processing. But, the Command/ModelLocator approach is considered more stable .02 -TH --- In flexcoders@yahoogroups.com, "Stefan Schmalhaus" <[EMAIL PROTECTED]> wrote: > > I've done some research on this list but haven't found any valid > information on what's considered best pratice in dealing with popup > windows. The few Cairngorm sample apps that are around don't seem to > use the TitleWindow component at all. > > Let's say I have a simple DataGrid populated with some user data. If I > click on a row in the DataGrid a popup window opens with a form for > editing the user information. The popup window also has two buttons > for deleting or saving (updating) the user account. > > I have done stuff like this several times in Flash/AS2 but I've never > used a framework approach so far. Now, if I look at this rather simple > task from a Cairngorm perspective it doesn't seem to be that simple > any more. (But I guess that's because I'm not yet too familiar with > Cairngorm.) I know how to establish databinding between the data > provider and {model.users} and all this basic Cairngorm stuff. > > But what happens when a row is clicked? I'm not even sure if I'm > supposed to treat this event as a single event ("selectUser" or > "openPopup"?) or as a chain of two events ("selectUser" -> > "openPopup"). Since my user information is organized as an array of > value objects it's easy to assign the selected user VO to > model.selectedUser: > > model.selectedUser = UserVO(userList.selectedItem); > > But am I "allowed" to directly access the ModelLocator from my view > component? Or am I supposed to route this simple action through the > Cairngorm "command chain" (Cairngorm Event -> Front Controller -> > Command Class -> ModelLocator)? > > Next question, what about the popup itself? Can I simply use > PopUpManager.createPopUp( this, UserFormView , true)? Or am I supposed > to treat this as a Cairngorm Event, too? > > I feel in "safe Cairngorm terrain" again with the "updateUser" and > "deleteUser" actions on the buttons. But what about closing the popup > window? Is this even worth a Cairngorm event? > > I guess these questions sound rather stupid to those of you who are > more experienced with frameworks. But at the moment these questions > are obstacles on my way to master Cairngorm (which I will hopefully do > one day). I apologize for my verbose post and my bad English, but I > hope that someone can shed some light on these issues. > > Stefan > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/