Hello,

A common experience: You start to develop a new rails application. When
controller method code is growing, you will put parts of its code under
the private section at the end of the controller, because you want the
public methods to reflect the processing logic, not the calculation
detail. Later on, this private controller section is also growing. You
detect that it consists of many private methods, which could be grouped
thematically. What is best practice now? Creating my own classes and
putting them into the rails lib directory? These classes would be of
singleton type, because it would make no sense to instantiate them more
than once: they are just a collection of thematically grouped methods,
not really an "object".

Instead of putting the classes under the lib directory, one could also
create app/my_logic/ directories,
and put the classes there. Is there any difference? Of course, in the
last case, one would have to tell rails to also look into the my_logic
directories...

What's your experience? What is best practice, to keep the overview over
your code?

Thanks and regards,
Martin
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to