CRUD
2016-03-19 16:16
176 查看
Create, read, update and delete
From Wikipedia, the free encyclopedia"CRUD" redirects here. For other uses, see Crud.
In computer programming, create,
read, update and delete[1] (as
an acronym CRUD) (Sometimes called SCRUD with an "S" for
Search) are the four basic functions of persistent storage.[2] Sometimes CRUD is
expanded with the words retrieve instead of read, modify instead of update, or destroy instead of delete. It is also sometimes used to describe user
interface conventions that facilitate viewing, searching, and changing information; often using computer-based forms and reports.
The term was likely first popularized by James Martin in his 1983 book Managing the Data-base
Environment.[1][3] The
acronym may be extended to CRUDL to cover listing of large data sets which bring additional complexity such as pagination when
the data sets are too large to hold easily in memory.
Another variation of CRUD is BREAD, an acronym for "Browse, Read, Edit, Add, Delete".[citation
needed] This extension is mostly used in context with data protection concepts, when it is legally not allowed to delete data directly. Locking the data prevents the access for users without destroying still needed data. Yet another variation,
used before CRUD became more common, is MADS, an acronym for "Modify, All, Delete, Show."[citation
needed]
Contents
[hide]1Database
applications
2User
interface
3See
also
4References
Database applications[edit]
The acronym CRUD refers to all of the major functions that are implemented in relationaldatabase applications. Each letter in the acronym can map to a standard SQL statement, HTTP
method (this is typically used to build RESTful APIs[4])
or DDS operation:
Operation | SQL | HTTP | DDS |
---|---|---|---|
Create | INSERT | PUT / POST | write |
Read (Retrieve) | SELECT | GET | read / take |
Update (Modify) | UPDATE | POST / PUT / PATCH | write |
Delete (Destroy) | DELETE | DELETE | dispose |
for the server to decide at what URI to make the new resource available, whilst PUT dictates what URI to use; URIs are of course a concept that doesn't really line up with CRUD. The significant point about PUT is that it will replace whatever resource the
URI was previously referring to with a brand new version, hence the PUT method being listed for Update as well. PUT is a 'replace' operation, which one could argue is not 'update'.
Although a relational database provides a common persistence
layer in software applications, numerous other persistence layers exist. CRUD functionality can be implemented with an object
database, an XML database, flat
text files, custom file formats, tape, or card, for example.
User interface[edit]
CRUD is also relevant at the user interface level of most applications. For example, in addressbook software, the basic storage unit is an individual contact entry. As
a bare minimum, the software must allow the user to
Create or add new entries
Read, retrieve, search, or view existing entries
Update or edit existing entries
Delete/deactivate existing entries
Without at least these four operations, the software cannot be considered complete. Because these operations are so fundamental, they are often documented and described under one comprehensive
heading, such as "contact management", "content management" or "contact maintenance" (or "document management" in general, depending on the basic storage unit for the particular application).
See also[edit]
Representational state transfer (REST)Active record pattern
Data manipulation language
References[edit]
^ Jumpup to: a b Managing
the Data-base Environment, p. 381, at Google Books
Jump
up ^ Heller, Martin (29 January 2007). "REST
and CRUD: the Impedance Mismatch". Developer World. InfoWorld.
Jump
up ^ Martin,
James (1983). Managing the Data-base Environment. Englewood Cliffs, New Jersey: Prentice-Hall. p. 381. ISBN 0-135-50582-8.
Jump
up ^ Tom Spencer (2014). "No
REST for the whippet.".
相关文章推荐
- 19. Remove Nth Node From End of List
- 构建之法阅读笔记02
- (转)C# 温故而知新:Stream篇(二)
- BZOJ 3227: [Sdoi2008]红黑树(tree)
- HTTP Header 详解
- java学习之在myclipse中利用jdbc连接数据库
- ACM--POJ-1182-食物链-并查集
- Java中private , public , protected 几个关键字
- SQL Server启动的几种方法
- LeetCode 144 Binary Tree Preorder Traversal(二叉树的前序遍历)+(二叉树、迭代)
- 四则运算3开发简介
- 0318函数及时间学习心得
- c#学习
- Android App中实现可以双击放大和缩小图片功能的实例
- iOS开发-关于自定义控件很值得一看的文章(二)
- Git 忽略一些文件不加入版本控制
- iOS-----Xcode-Debug尝试
- 学习进度条第三周
- 高次多项式因式分解
- Linux笔记(60)——详解apache集成php