From: Marcelo Barbudas Date: 2009-05-06T02:46:02+09:00 Subject: Re: modules and classes question > I do not have insights into AWS beyond what can be gatherere from > http://amazon.rubyforge.org/. I don't find this pattern very > appealing. For something like this to work you need to resort to some > form of global state (global variable, constant, class instance > variable, thread local variable) which means there is potential for > problems when working with multiple threads. Another issue is that it > is not obvious, i.e. you do not see that there is something > transported behind the scenes. > > I would at least refrain from placing this pattern in a library unless > it is thread safe and it is sure that there will and can never be the > need for more than a single connection which seems doubtful in case of > AWS. > I understand. How do you mimic an ActiveResource like structure then? Something like: conn = Main.new(user, pass) conn.resources.method_from_resource_class_that_uses_main_for the_actual_request_method -- M.