Ruby On Rails - Philosophy and Design

Philosophy and Design

Ruby on Rails is intended to emphasize Convention over Configuration (CoC), and the rapid development principle of Don't Repeat Yourself (DRY).

"Convention over Configuration" means a developer only needs to specify unconventional aspects of the application. For example, if there is a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products sold", that the developer needs to write code regarding these names. Generally, Ruby on Rails conventions lead to less code and less repetition.

"Don't repeat yourself" means that information is located in a single, unambiguous place. For example, using the ActiveRecord module of Rails, the developer does not need to specify database column names in class definitions. Instead, Ruby on Rails can retrieve this information from the database based on the class name.

"Fat models, skinny controllers" means that most of the application logic should be placed within the model while leaving the controller as light as possible.

Read more about this topic:  Ruby On Rails

Famous quotes containing the words philosophy and/or design:

    Methinks it would be some advantage to philosophy if men were named merely in the gross, as they are known. It would be necessary only to know the genus and perhaps the race or variety, to know the individual. We are not prepared to believe that every private soldier in a Roman army had a name of his own,—because we have not supposed that he had a character of his own.
    Henry David Thoreau (1817–1862)

    I always consider the settlement of America with reverence and wonder, as the opening of a grand scene and design in providence, for the illumination of the ignorant and the emancipation of the slavish part of mankind all over the earth.
    John Adams (1735–1826)