From: Derek Cannon Date: 2010-04-16T16:49:35+09:00 Subject: Re: Is this good OOP structuring? Robert, I think you were meaning to thank Josh! Anyway, thanks very much Josh for the great explanations. That answered all my questions! And Robert, your example really helped -- it was a great concrete example. I guess my only question now is: when is it appropriate to make methods static? In the example that was given earlier: >class CourseController > def initialize(...) # whatever it needs > end > > def self.read_url(url) > ... > cc = new(...) > ... > cc > end > > def self.read_file(file_name) > end >end I understand how one would use CourseController.read_url(xxx) and CourseController.read_file(xxx), but I don't understand why I'd need it. Without it being static, I could just make references to the instance variables, in this case, the url -- which would be passed through in the initialize constructor). That would eliminate the need for the parameter that both static methods carry, right? Am I missing something about when static methods should be used? Thanks, Derek -- Posted via http://www.ruby-forum.com/.