开发者

Object Orientation, Rails

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?


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.


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


I probably would have talked about ActiveRecord.


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.


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜