In company training, a group of about 2 to 3 people is supposed to create a virtual project. The project uses Spring Tool Suite (STS), but since there was no such thing as a manual for trainees, I summarized from the introduction to setting up a local host and checking the web page. It's for people who are new to programming, so I'm writing even the basics.
The article is divided into three parts. ** 1. Explanation of MVC model ← Now here ** 2. From the introduction of STS to Japanese localization by Pleiades 3. From creating a project to checking the page on the local host
Before downloading STS, let's start with an explanation of the MVC model, which is the design concept of web applications. Please keep in touch with us from the beginning without thinking that it is a lecture.
The MVC model is, in a nutshell, one of the design concepts of web applications. When a developer implements a web application as he or she wants, it tends to cause troubles that only that person can understand or bugs occur, and it is also a security aspect to refer to data directly from the client side. I'm not sure. Therefore, it is a story to decide and implement rules on what to do and how to move it in various places. The roles of each are as follows.
M : Model The part that actually performs some processing, such as calculation and access to the data layer. Named logic or service. It is called by the Controller and returns the operation result and the data acquired from the database. V : View Generated by the Controller and sent to the client. As the name implies, it is the part that looks like, and includes graphs and diagrams, as well as the HTML files required for web pages. C : Controller It confirms the contents of the HTTP request, calls the appropriate Model, generates the operation result and data as a View, and sends it back to the client (HTTP response).
Example) Client enters keywords on a web page ↓ Controller receives the keyword and skips to Model to access the database ↓ Model accesses the database, gets the data associated with the keyword and returns it to Controller ↓ Controller creates an HTML file as View, describes the data acquired from Model in the file, and sends it to the client. ↓ Web page transitions and a list of data associated with keywords is displayed
The MVC model is just a design concept, and we do not explicitly set it as an MVC model in development. That said, if you are not aware of the MVC model, it may happen that something other than the Controller receives the request, or that you put completely unrelated arithmetic processing in one Model. Code that can only be understood by the person who implements it will be an obstacle later even if it works on the spot, so I think it is better to proceed with development while keeping it in the corner of your head.
That's a brief description of the MVC model. Next time, I would like to download STS and proceed to Japanese localization.
Next time: From the introduction of STS to Japanese localization by Pleiades