On Friday, July 25, 2014 11:12:26 AM UTC-5, Rodrigo Rosenfeld Rosas wrote: > > Aaron's recent talk at BigDot Ruby <snip> got me thinking about object > > allocation and the Rails singleton. > > I'm curious, why is this related to that talk >
> Do you have any use case where you'd want to instantiate > Rails::Application that would be better than inherit a new class? > > Just thinking about object allocation made me think of the Rails singleton, though I admit the implication of my association is that there would be a case where one would want multiple instance of a Rails object, which is not a case I have thought about. I also just think of the Singleton pattern as a kind of strange as it's not far removed from being a utility function class. To wit, we call Rails::Application.initialize! but why does that need to fire once on the 'singleton' instance rather that on the class, since class instance variables are a thing. And now that Rails.application behaves very much like Rails::Application's subclass, the distinction is decreasing. (Thanks for your response, so for delay as I somehow didn't see it) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
