views:

126

answers:

5

I was asked this question, "How do you see Object Orientation in terms of rails?". What would be a perfect answer for this in an interview?

+1  A: 

The perfect answer would be "What do you mean by that?", since "how do you see" is a pretty vague term.

Craig Walker
A: 

I probably would have talked about ActiveRecord.

Woot4Moo
A: 

Rails is a framework built using Ruby and so is completely Object Oriented?

I guess the question is asking what the objects in a rails app are and how they are used in the lifecycle of a rails app. Also how the three important components - Models, Controllers & Views are inherited from Classes which already have methods and properties.

But you should really ask counter questions because you could give a long speech as an answer if you talk in general.

rohit.arondekar
A: 

I would say - OOP in rails is underrated.

Because ruby is dynamic language and rails focuses more on conventions rather than anything else.


Fully subjective. Actually - i'm not even a RoR developer...

Arnis L.
+1  A: 

This is an open-ended question giving you the opportunity to show your Ruby, Rails, and general OO knowledge.

I'd start by talking about the differences and constraints of Rails compared to plain Ruby which would show both your understand of Ruby's Object model and Rails' constraints and idiosyncrasies. Notably, one must talk of Single Table Inheritance and the potential problems of using it as opposed to having separate classes and tables (though one could still use inheritance in abstract classes for the business logic).

Furthermore, you could talk about how Rails works, e.g. its heavy use of delegation through proxies, though this might be going too deep, but it would show understanding of the inner workings of Rails which is needed if anything 'unusual' needs to be done.

Finally, I'd talk about design patterns, since Rails' success was harnessing many patterns and paradigms such as MVC and ActiveRecord - things we now take for granted.

topherx