Rails把java的方式戲稱為XML仰臥起坐(sit-ups)。
Rails是一個完整的,開源的web開發架構,更多的快樂和更少的代碼。
貫穿整個架構的是DRY(不要重複)原則,具體體現比如:定義好資料庫表後,類名字和對象屬性名稱字都自動確定了。用過hibernate的朋友知道我在說什麼(你也許會說xdoclet, 那不也得學嗎)。
學習成本低,不需要學習各種XML花式(學習過struts,spring,hiber,webwork,ant,maven的朋友知道我在說什麼),只需要學習Ruby語言就夠了。
編程的快樂又回來了,沒有編譯和部署,即改即得,所有的複雜都隱藏在架構內部了。
你感受到它的哲學了嗎?自己安裝試試看吧。
===========================================
作為對照,以下文字來自rails網站首頁:
Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups
Being a full-stack framework means that all layers are built to work seamlessly together. That way you Don’t Repeat Yourself (DRY) and you can use a single language from top to bottom. Everything from templates to control flow to business logic is written in Ruby—the language of love for industry heavy-weights.
In striving for DRY compliance, Rails shuns configuration files and annotations in favor of reflection and run-time extensions.
This means the end of XML files telling a story that has already been told in code. It means no compilation phase: Make a change, see it work. Meta-data is an implementation detail left for the framework to handle.