hello all, i''m starting on a rails app that will hopefully make machine maintenance much easier at my work. i have a few general questions about what approach to take in the design. for each machine the app maintains, it loads a networking library, connects to the machine and returns an object of that machine. commands to that machine are run via instance methods of the object. different machines use different versions of the networking library. once i''ve created the machine object, how do i pass it back and forth between actions? the rails documentation is very jumbled when it comes to this. -reid -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roger Pack
2008-Apr-30 03:53 UTC
Re: loading libraries and passing objects between actions
save it as a global ? On Tue, Apr 29, 2008 at 5:48 PM, Reid Oda <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hello all, > > i''m starting on a rails app that will hopefully make machine maintenance > much easier at my work. i have a few general questions about what > approach to take in the design. > > for each machine the app maintains, it loads a networking library, > connects to the machine and returns an object of that machine. commands > to that machine are run via instance methods of the object. different > machines use different versions of the networking library. > > once i''ve created the machine object, how do i pass it back and forth > between actions? the rails documentation is very jumbled when it comes > to this. > > -reid > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
browner than u
2008-Apr-30 17:15 UTC
Re: loading libraries and passing objects between actions
i''d like to try to avoid having too many global variables. isn''t there a way to pass objects from action to action? Roger Pack wrote:> save it as a global ? > > On Tue, Apr 29, 2008 at 5:48 PM, Reid Oda-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-30 18:29 UTC
Re: loading libraries and passing objects between actions
On 30 Apr 2008, at 18:15, browner than u wrote:> > i''d like to try to avoid having too many global variables. isn''t > there > a way to pass objects from action to action? >global variables are a horrendously bad idea. If you want something to persist across actions use the database, the session, memcached etc... Fred> Roger Pack wrote: >> save it as a global ? >> >> On Tue, Apr 29, 2008 at 5:48 PM, Reid Oda > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
browner than u
2008-Apr-30 19:24 UTC
Re: loading libraries and passing objects between actions
Frederick Cheung wrote:> On 30 Apr 2008, at 18:15, browner than u wrote: > >> >> i''d like to try to avoid having too many global variables. isn''t >> there >> a way to pass objects from action to action? >> > global variables are a horrendously bad idea. If you want something to > persist across actions use the database, the session, memcached etc... > Fredall i want to do is pass a "computer" object (specific to the networking library i''m using) from action to action, just as i would in functional programming. is this not possible? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-30 19:30 UTC
Re: loading libraries and passing objects between actions
On 30 Apr 2008, at 20:24, browner than u wrote:> > Frederick Cheung wrote: >> On 30 Apr 2008, at 18:15, browner than u wrote: >> >>> >>> i''d like to try to avoid having too many global variables. isn''t >>> there >>> a way to pass objects from action to action? >>> >> global variables are a horrendously bad idea. If you want something >> to >> persist across actions use the database, the session, memcached >> etc... >> Fred > > all i want to do is pass a "computer" object (specific to the > networking > library i''m using) from action to action, just as i would in > functional > programming. is this not possible?It is possible, by storing it in one of those places I named. Maintaining large amounts of state across actions is not something web apps in general are good at. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
browner than u
2008-Apr-30 19:42 UTC
Re: loading libraries and passing objects between actions
Frederick Cheung wrote:>> programming. is this not possible? > > It is possible, by storing it in one of those places I named. > Maintaining large amounts of state across actions is not something web > apps in general are good at. > > Fredgreat. this is good info. thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---