May 2, 2021
CRUD is an essential acronym that models the life cycle of the objects in an application. Since these phases cover most of the application features, it is valuable to grasp the idea behind CRUD.
There are four main actions that form CRUD:
In this guide, we will go over some sample pages and explore CRUD operations they perform.
Almost all applications have object creation features like post sharing, task create and sign-up.
Even though the resulting objects have different types (for example, Tweet
, Task
and Account
), the concept is the same; objects are created with respect to the user input and stored in the database for future use.
Create tweet
Since read operations don't require any user input, it might be harder to identify them. Read actions are commonly used in two patterns:
tweet-detail
, task-detail
and account-detail
)tweet-list
, task-list
and account-list
)Read a single tweet
Read a set of tweets
Update operation works on existing instances to change one or more fields.
Since Twitter doesn't allow editing Tweet
instances, we will use profile editing to demonstrate the update method.
As we can see from the screenshot, an update operation can take files (for example, profile image
and profile banner
) or plain text inputs (for example, name
and bio
) to modify existing objects.
Update profile
Deletion is the last phase of an object's life cycle.
Services might remove instances completely, mark them as deleted or move them to trash. As a result, deleted instances are expected to be hidden from the users.
Delete tweet
Even though application pages, screens and features might vary drastically for each project, the principles behind CRUD operations are the same.
Please follow @crudfulcom and join Discord server for more!