Class were exported and became able to use in other files by importing them
→ This means that the core logics are written in the class file
→ As long as there happens more class files, the file structure gets a bit messy
Here, we’re using MVC .
--> APIs grouped as class
--> Inside controllers folder, there is service folder.
--> The core logic is insdie this service folder.
⇒ Business Logic : Logic inside the service === Core code
--> Controllers bring these services and construct the function with them.
ProductController is depending on CashService.
➡️ Here, to change the
ProductController itself should be changed.
➡️ Injecting the dependency from
const cashService = new CashService to cashService in index.js which is outside code.
➡️ Injecting the dependency by using nest.js.
const cashService = new CashService().
this.cashService: Common commands in nest.js
Q. If DI, then single-tone?
A: No it isn't. Single-tone is just a basic-normal format of nest.js.
=> This can be adjusted by developers.
Categorizing overlapping data to reduce the time for calling the data.
If the all data are organized in one row, it gets harder for the computer to read the data.
: In one column, multiple same-attribute data existing
Primary Key (= Primary Column)
While categorizing each types of data, there occures a Primary Key.
It's like grouping keys.
Normal Form #2 vs. Normal Form #3
If primary key is getting categorized, it's Normal Form #2.
🏁 Overall the result goes like this ↘️