As the title suggests, I will write how to make a TODO application in Java. This time I would like to explain what kind of values are flowing in Java before actually writing the code.
1: A brief description of MVC (here and now) 2: I want to make a template with Spring Initializr and make a Hello world
What is MVC
Model ... (interacting with and processing the database) View ... (Screen that is actually displayed to the user using HTML / CSS) Controller ... (Ask Model to process data or pass the returned data to View)
Each has a role like this.
So what about Java's MVC?
View, Controller, Service, Repository, Entity
In Java, it seems that it is common to do the Model part with classes called Service, Repository, Entity.
If you write the flow of TODO registration easily
The registration button is pressed on View and the registration details are sent.
The registered contents are passed to the Controller method.
Controller passes the registration details to the Service class.
Service class applies the registered contents to the variable of Entity class and saves it in the database by the method of Repository class.
It is a flow like.
To be honest, I don't think it's easy to grasp this, so I'll explain it one by one in future articles!