What is CRUD , COC and DRY in RoR ?

CRUD

CRUD stands for Create, Read, Update, Delete.

CRUD forms the basis of most dynamic websites in that they generally have data and function that:

  • C reate new records
  • R ead existing records
  • U pdate existing records
  • D elete existing records.

RubyOnRails gives you all your CRUD, so you can get on with building the exciting stuff.

Convention over Configuration (CoC) & DRY

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, this leads 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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s