Skip to content

Commit 632612d

Browse files
osamaakblouisrli
andauthored
Apply suggestions from code review
Co-authored-by: Louis Li <[email protected]>
1 parent ff6c712 commit 632612d

File tree

3 files changed

+4
-4
lines changed
  • module3-crud-and-data-models

3 files changed

+4
-4
lines changed

module3-crud-and-data-models/r1-schema-and-data-models/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ We will need to send the `dish` data too.
7070

7171
To read resources in a REST environment, we use the GET method. in practice, reading a resource shouldn't change any information - it should only retrieve it.
7272

73-
Note: technically, you can change data in a `GET` request but since we are creating a RESTful API, you shouldn't do that, and, in-general, changing data in a `GET` request would be confusing to the users of your api.
73+
To read resources in a REST environment, we use the GET method. Reading a resource should never change any information - it should only retrieve it. REST itself is more like a set of guidelines. Technically, you can change data in a `GET` request, but since we are creating a RESTful API, you shouldn't do that. Having a GET request that updates data in your database would be confusing to the users of your API and violate the expected behavior of REST.
7474

7575
##### Request:
7676

module3-crud-and-data-models/r1.1-principles-of-setting-up-your-schema/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This is not so much a "storage space" issue as it is a "data consistency" issue.
4646

4747
##### 3. Avoid JOINs and $lookups if they can be avoided, but don't be afraid if they can provide a better schema design.
4848

49-
Having a JOIN or $lookup means you are doing some kind of search in your database for the corresponding field and that operation takes time. So if you embed your data in a single object, you will spare this operation, and your query can be much faster and cleaner.
49+
Having a JOIN or `$lookup` means you are doing some kind of search in your database for the corresponding field and that operation takes time. So if you embed your data in a single object, you will spare this operation, and your query can be much faster and cleaner.
5050

5151
##### 4. How you model your data depends _entirely_ on your particular application's data access patterns.
5252

module3-crud-and-data-models/r3-model-view-controller/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Introduction to MVC projects
44

5-
When beginning a new project (especially, when using express), there are several different methods that can be used to set up the overall file structure and flow. One of the most commonly used architectural patterns is called MVC. this acronym stands for "Model, View, Controller".
6-
This pattern is favored because of its alignment with the computer science design principle, [**separation of concerns**](https://en.wikipedia.org/wiki/Separation_of_concerns). By dividing up responsibilities within our file structure, for example, we can have our db connection work in one file and api routes in another file, ...etc.
5+
When beginning a new project (especially when using express), there are several different methods that can be used to set up the overall file structure and flow. One of the most commonly used architectural patterns is called MVC. this acronym stands for "Model, View, Controller".
6+
This pattern is commonly found because of its alignment with the computer science design principle, [**separation of concerns**](https://en.wikipedia.org/wiki/Separation_of_concerns). By dividing up responsibilities within our file structure, for example, we can have our db connection work in one file and api routes in another file, and so on. Such organization is beneficial for both our own and other people's understanding of our code.```
77

88
```
99
app-name-here

0 commit comments

Comments
 (0)