CRUD

from Wikipedia, the free encyclopedia

The acronym CRUD [ kɹʌd ] encompasses the four basic operations of persistent storage

  • C reate ,createdata record,
  • R ead or Retrieve , read data record,
  • U pdate , update record, and
  • D elete or D estroy , delete data record.

Some authors use the acronym RUDI ( insert instead of create ) or CDUR (based on the key of C major ).

CRUD language constructs

CRUD operations can be expressed in different language constructs depending on the environment:

CRUD operation SQL -92 HTTP ( REST )
Create INSERT PUT or POST
Read (retrieve) SELECT GET
Update UPDATE PATCH or PUT
Delete (Destroy) DELETE DELETE

CRUD frameworks

In many cases, the individual CRUD operations are implemented using a persistence layer. The persistence layer raises the relational representation of the individual information to an object-oriented level. If the individual data objects are also visualized in a generic GUI so that each object can be manipulated using one of the CRUD operations mentioned, then one speaks in this context of a CRUD framework . The following illustration is taken from the naked objects documentation and shows the possible structure of such a CRUD framework.

Comparison of conventional framework (left) versus CRUD framework (right) using the example of naked objects

The graphical user interface of a CRUD framework is often a simple HTML interface. The CRUD framework typically takes individual transaction steps into account . As a result, data is only saved if the Save or Next button has been pressed within the HTML interface . If this is the case, the update operation is ultimately carried out.

The CRUD framework of course exhibits equivalent behavior for the remaining CRUD operations. A CRUD operation is therefore an atomic process .

Atomic operations are of interest in this context, since modern software applications are often implemented as multi-user systems. A CRUD framework allows a data record to be read and written even if the two operations take place at a very different time. Nevertheless, other people are allowed to read out the same data set during this time. As a result, the record was not locked.

Examples

Here are some examples of CRUD implementations, broken down by language or platform :

Individual evidence

  1. philiplb / CRUDlex GitHub
  2. FuelPHP Documentation - Model_Crud Class
  3. Qcodo
  4. http://www.gantry-framework.org/
  5. http://turbogears.org/