16 June 2010
0 DRY in Ruby On Rails- 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
Labels:
RoR,
Ruby On Rails,
Tutorials,
Web Technologies
Subscribe to:
Post Comments (Atom)
0 comments:
Please give your valuable comments.