星期三, 3月 28, 2007

I bought it on ebay.

Ruby on Rails 簡介


資料來源: Agile Web Development with Rails

Ruby on Rails 是讓開發,佈署與維護更簡單的框架。

應用程式被分解為三種元素: models,views,controllers(MVC)
  • The model is responsible for maintaining the state of the application.A model is more than just data; it enforces all the business rules that apply to that data.
  • The view is responsible for generating a user interface, normally based on data in the model.
  • Controllers orchestrate the application. controllers receive events from the outside world, interact with the model,and display an approach view to the user.
當然有許多的 Web develop framework 使用 MVC 模式。
那麼 ruby on rails 有甚麼特色呢?

  • 在 Model 方面,採用了 Object-Relational Mapping(ORM),也就是將資料庫的表格對應到 class。可對應的包括table 的欄位,table 與 table 的關係與 table 的內容邏輯性。
    例如:
    Order.find(:all , :conditions => "name='dave'").each do |order|
    puts order.amount
    end
  • 在view 方面,動態頁面由 templates 產生,其包含了三個元素(原文 flavors)
    1. rhtml,最簡單也最容易。( 靜態頁面加上動態產生的元素)
    2. rjs,允許在 server 創建 JavaScript 片段並且在 broswer 執行
  • controller 是應用的邏輯中心,並負責將外部的請求以轉到內部的 action,而這個過程僅以簡單的 URL 表達。
    例如 http://127.0.0.1/say/hello
    say -> controller
    hello -> action

星期二, 3月 27, 2007

Super Mario Galaxy GDC 2007 影片

The Legend of Zelda : Twilight princess 玩後感

在新年前,我哥忽然的將 Wii 給帶了回來,連帶遊戲也多了幾片。其中一片就是 The Legend of Zelda : Twilight Princess。

The Legend of Zelda (薩爾達傳說) 是世界上知名的遊戲系列作。由 Nintendo(任天堂) 發行。其最早一代發行在紅白機上面。到了今天已經有超過20年的歷史了。

這一系列中我第一次玩的作品是 The Legend of Zelda : Ocarina of Time,為 N64 上的作品,後來才知道這是整個系列作第一次 3D 化的作品。在一個立體的空間中進行觀察,戰鬥,並且思考可能的通過方法。大致就是這遊戲的主要內容。

有鑑於 Ocarina of Time 的成功(全球一致好評,全球銷量超過 700 萬份),Twilight Princess 的製作目標就是超越 Ocarina of Time。在破關之後我認為仍然有些不足處。

  1. Boss 華而不實,幾乎都很快可以打完
  2. 過場的動畫我感動不起來,當然可能跟看不懂日文有關。不過我是覺得有點做作。
  3. 一些人物到後半段幾乎就沒戲份了。
  4. 氣氛塑造上不如 Ocarina of Time

但仍然有所突破處
  1. 整個環境感塑造的非常大,在平原上跟海拉爾湖都走到想摔手把
  2. 控制上更為直覺,特別是瞄準的功能。
  3. 可以控制的動作更多,但是蠻直覺得
可能 Ocarina of Time 製作的太成功難以超越了
希望任天堂可以再接再厲的製作 Wii 上的原生薩爾達