[flexcoders] Resetting an application's view for new user
Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
RE: [flexcoders] Resetting an application's view for new user
Here is what I do: public function logOff():void { var ur:URLRequest = new URLRequest(_sAppUrl); navigateToURL(ur,_self); }//logOff _sAppUrl comes from the browser: location.href Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Hardy Sent: Wednesday, December 03, 2008 10:32 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
Re: [flexcoders] Resetting an application's view for new user
That's a good idea. I wonder if there's a way to do something similar in AIR considering you can't make the AIR executable restart itself (from what I know...without a bridge like Merapi). Maybe there's a way to essentially reload the contents of the AIR app without actually re-starting the executable? Thank you very much for your feedback! Aaron On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED] wrote: Here is what I do: *public* *function* logOff():*void* { *var* ur:URLRequest = *new* URLRequest(_sAppUrl); navigateToURL(ur,*_self*); }*//logOff* _sAppUrl comes from the browser: location.href Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron Hardy *Sent:* Wednesday, December 03, 2008 10:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
RE: [flexcoders] Resetting an application's view for new user
If you have an initialisation process which resets all state variables when the application starts you could just run that process again? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Hardy Sent: Friday, 5 December 2008 8:22 a.m. To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Resetting an application's view for new user That's a good idea. I wonder if there's a way to do something similar in AIR considering you can't make the AIR executable restart itself (from what I know...without a bridge like Merapi). Maybe there's a way to essentially reload the contents of the AIR app without actually re-starting the executable? Thank you very much for your feedback! Aaron On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Here is what I do: public function logOff():vo id { var ur:URLRequest = new URLRequest(_sAppUrl); navigateToURL(ur,_self); }//logOff _sAppUrl comes from the browser: location.href Tracy From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Aaron Hardy Sent: Wednesday, December 03, 2008 10:32 PM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
RE: [flexcoders] Resetting an application's view for new user
Doh!, I missed the AIR. (I know, the fifth word, capitalized and all that. Mea culpa.) Maybe someone with some AIR experience else will be able to help. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Hardy Sent: Thursday, December 04, 2008 2:22 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Resetting an application's view for new user That's a good idea. I wonder if there's a way to do something similar in AIR considering you can't make the AIR executable restart itself (from what I know...without a bridge like Merapi). Maybe there's a way to essentially reload the contents of the AIR app without actually re-starting the executable? Thank you very much for your feedback! Aaron On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Here is what I do: public function logOff():void { var ur:URLRequest = new URLRequest(_sAppUrl); navigateToURL(ur,_self); }//logOff _sAppUrl comes from the browser: location.href Tracy From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ] On Behalf Of Aaron Hardy Sent: Wednesday, December 03, 2008 10:32 PM To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com Subject: [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
Re: [flexcoders] Resetting an application's view for new user
Yeah, I think that would be akin to the first option described in my initial email. The difficulty with that is making sure that all state variables really do get reset. If new view combinations are added to the system later, the developer is required to ensure they are also included in the reinitialization process. Something that really ensures that everything is at a clean slate and doesn't leave room for error on the developer's part would be really nice. Tracy's recommendation is great for that since it basically re-loads the SWF completely, but I'm not sure there's an AIR-based alternative. Aaron On Thu, Dec 4, 2008 at 12:48 PM, Wildbore, Brendon [EMAIL PROTECTED] wrote: If you have an initialisation process which resets all state variables when the application starts you could just run that process again? -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron Hardy *Sent:* Friday, 5 December 2008 8:22 a.m. *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Resetting an application's view for new user That's a good idea. I wonder if there's a way to do something similar in AIR considering you can't make the AIR executable restart itself (from what I know...without a bridge like Merapi). Maybe there's a way to essentially reload the contents of the AIR app without actually re-starting the executable? Thank you very much for your feedback! Aaron On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED] wrote: Here is what I do: *public* *function* logOff():*vo id* { *var* ur:URLRequest = *new* URLRequest(_sAppUrl); navigateToURL(ur,*_self*); }*//logOff* _sAppUrl comes from the browser: location.href Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron Hardy *Sent:* Wednesday, December 03, 2008 10:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
RE: [flexcoders] Resetting an application's view for new user
Yep true, Sorry Aaron I missed the initial email. Tracys recommendation is simple and perfect for flex web based apps, Air apps are another issue. Could you perhaps hold all state variables in a bindable associative array or object, then just rebuild the object? Are you using any recognised framework for your app? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Hardy Sent: Friday, 5 December 2008 9:38 a.m. To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Resetting an application's view for new user Yeah, I think that would be akin to the first option described in my initial email. The difficulty with that is making sure that all state variables really do get reset. If new view combinations are added to the system later, the developer is required to ensure they are also included in the reinitialization process. Something that really ensures that everything is at a clean slate and doesn't leave room for error on the developer's part would be really nice. Tracy's recommendation is great for that since it basically re-loads the SWF completely, but I'm not sure there's an AIR-based alternative. Aaron On Thu, Dec 4, 2008 at 12:48 PM, Wildbore, Brendon [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: If you have an initialisation process which resets all state variables when the application starts you could just run that process again? From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Aaron Hardy Sent: Friday, 5 December 2008 8:22 a.m. To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: Re: [flexcoders] Resetting an application's view for new user That's a good idea. I wonder if there's a way to do something similar in AIR considering you can't make the AIR executable restart itself (from what I know...without a bridge like Merapi). Maybe there's a way to essentially reload the contents of the AIR app without actually re-starting the executable? Thank you very much for your feedback! Aaron On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Here is what I do: public function logOff():vo id { var ur:URLRequest = new URLRequest(_sAppUrl); navigateToURL(ur,_self); }//logOff _sAppUrl comes from the browser: location.href Tracy From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On Behalf Of Aaron Hardy Sent: Wednesday, December 03, 2008 10:32 PM To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com Subject: [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron
Re: [flexcoders] Resetting an application's view for new user
Yeah, something like that would probably work. On the other hand, I gave the code at the bottom of this page a try: http://www.docsultant.com/site2/articles/flex_internals.html and it seemed to work very well for restarting the AIR app. I think I'm going to take that approach. If anyone knows of a better approach, I'd love to hear about it. Thanks again, Aaron On Thu, Dec 4, 2008 at 1:47 PM, Wildbore, Brendon [EMAIL PROTECTED] wrote: Yep true, Sorry Aaron I missed the initial email. Tracys recommendation is simple and perfect for flex web based apps, Air apps are another issue. Could you perhaps hold all state variables in a bindable associative array or object, then just rebuild the object? Are you using any recognised framework for your app? -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron Hardy *Sent:* Friday, 5 December 2008 9:38 a.m. *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Resetting an application's view for new user Yeah, I think that would be akin to the first option described in my initial email. The difficulty with that is making sure that all state variables really do get reset. If new view combinations are added to the system later, the developer is required to ensure they are also included in the reinitialization process. Something that really ensures that everything is at a clean slate and doesn't leave room for error on the developer's part would be really nice. Tracy's recommendation is great for that since it basically re-loads the SWF completely, but I'm not sure there's an AIR-based alternative. Aaron On Thu, Dec 4, 2008 at 12:48 PM, Wildbore, Brendon [EMAIL PROTECTED] wrote: If you have an initialisation process which resets all state variables when the application starts you could just run that process again? -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron Hardy *Sent:* Friday, 5 December 2008 8:22 a.m. *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Resetting an application's view for new user That's a good idea. I wonder if there's a way to do something similar in AIR considering you can't make the AIR executable restart itself (from what I know...without a bridge like Merapi). Maybe there's a way to essentially reload the contents of the AIR app without actually re-starting the executable? Thank you very much for your feedback! Aaron On Thu, Dec 4, 2008 at 11:15 AM, Tracy Spratt [EMAIL PROTECTED] wrote: Here is what I do: *public* *function* logOff():*vo id* { *var* ur:URLRequest = *new* URLRequest(_sAppUrl); navigateToURL(ur,*_self*); }*//logOff* _sAppUrl comes from the browser: location.href Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron Hardy *Sent:* Wednesday, December 03, 2008 10:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Resetting an application's view for new user Hey flexers, I have a hefty AIR application with many different view combinations, forms filled with data, etc. When a user logs out and a different user logs in, I need the application to be reset so that everything looks as though no other user was previously logged in. I've ran into two solutions: 1) Reset all the forms, views, etc to their original state when the first user logs out. This can be tricky getting everything back to its initial state. 2) Make the main view (what would be the main application file in option #1) a separate component. When the user logs out, let the whole component get garbage collected. When the new user logs in, reinstantiate the main view to ensure its all in its initial state once again. With this option, there's not as much worrying about whether you've successfully reset everything since it's a brand new instance. However, processing time and memory management may be a new issue to deal with. So, I'm curious, how do you folks go about this in your projects? Thanks! Aaron