15 June 2010

0 What is DRY- Don't Repeat Yourself

DRY- Don't Repeat Yourself is the principle of Ruby On Rails (RoR). Information is located in a single, unambiguous place. DRY principle means that settings only need to be specified in one place. Rails ensures that these definitions are visible to all the other web components that need them. For example, the developer does not need to specify database column names in class definitions. Instead, Ruby can retrieve this information from the database.

  • Reusing data
    e.g. no need to declare table field names – can be read from database
  • Metaprogramming
    dynamically created methods
  • Less code – more work on each line of code
    e.g. specific keywords like find_all to query database


0 comments:

Feeds Comments

Please give your valuable comments.