Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the preface and environment building method of developing single web shop with springboot

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Springboot development monomer web shop preface introduction and environment building methods, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Introduction of preface and brief introduction of environment construction

Springboot itself is for service use, so why should we use it in the opposite direction to develop a single web application? In our actual development work, there are still a large number of business systems using single applications, especially for small and medium-sized teams, it is not worth the loss to choose service-oriented development at the beginning of project development, because for such teams, all the work is bound to be done by our developers.

Small teams or small companies if developers devote large-scale efforts to work outside the business, then our development efficiency is bound to be particularly inefficient, when we develop a version of the system, perhaps this kind of requirements are no longer so in line with the current development, such teams pursue short and fast and easy to deploy updates. Some people will ask, then why don't we choose SpringMVC? Of course, if the team already has a set of SpringMVC framework that can be used immediately, it is also completely ok, but all students who have used Springboot know it.

1.Springboot helps us to internalize the configuration that we used to configure with XML in SpringMVC, so developers can devote a lot of energy to business research and optimization without paying attention to how it is configured.

two。 As for technology selection, we must think that our business may expand at a high speed, and in the later stage, we must be able to quickly update the technical system or upgrade the system, then the instinctive service of springboot can be reflected.

3. Many new students in the study of springboot, too much material itself is a kind of demo learning, is the need for further research to apply what you have learned, not very close to production, I hope that through this development, we can directly develop a set of production and use of demo system.

Business analysis

When developing any new system, what we want to achieve is an e-commerce platform, so what business functions do we have to consider a basic e-commerce platform?

The picture above shows the simplest module information to implement an e-commerce.

Technology selection

When selecting technology types, I suggest following several principles:

Meet the actual needs of the business (any technology that is separated from the business is useless)

The ability of team members (it should be in line with the actual situation of team members, otherwise it will be very slow to start)

Technology community activity (choosing highly active technologies is very important for late troubleshooting, and more importantly, most of the errors have already been tried by others.

Security (essential choice)

But after referring to Poc, I chose to give up OSGI

Our theme makes it clear that we are going to use springboot to implement a web project, so seize on these two key points. Since we use Springboot, we use the latest version of 2.2.0.RELEASE here. Since it is a web project, we must use the technology related to web, tomcat (built-in springboot), and we adopt the technology of separating the front and back ends. The back end provides the api of restful, and the front end uses jquery & vuejs. Since it is a real project, the database is also essential to us. We use MYSQL 8. 0 bridge, so our java interacts with db, and we use mybatis as the bridge. The basic technology is enough for us to use, so the specific dependent package will be introduced one by one later.

SpringBoot 2.2.0.RELEASE

Mysql 8.0.18

Mybatis 3.4.6

Development tools

If you do well in advance, you must sharpen your tools beforehand. here are your personal tools for reference only:

IntelliJ IDEA (code tools)

Free Mybatis Plugin (help us with the method and SQL jump)

Lombok (use annotations to save too much codes and improve efficiency)

Maven Helper (help with dependency analysis)

Restful Toolkit (can achieve the same simple effect as postman, but also help us generate part of the test information)

... Other plug-ins will have their own aspirations.

Mysql Workbench (Mysql tools)

PDman (database design tool, version control of scripts is easy to use)

Talk is cheap, show me the codes

No matter how much you say, you might as well say something real, so let's start our performance.

Create a single project structure

First we need to create a Maven parent module to put all our module information together, such as service,controller and so on.

Create Parent Module expensive-shop

Open IDEA and select File = > New = > Project

Click Next and enter GroupId & artifactId respectively

Click Next to modify the project name (it doesn't matter if you don't change it)

Click Finish

At this point, src and pom.xml are generated because the project is a parent project and there is no code implementation, so delete the src directory and modify the pom.xml file.

4.0.0 org.springframework.boot spring-boot-starter-parent 2.2.0.RELEASE com.life-runner expensive-shop 1.0-SNAPSHOT expensive-shop develop an on-line shop pom UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter Org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-configuration-processor true org.springframework.boot spring-boot-starter-actuator org.projectlombok Lombok 1.18.8

Mainly focus on 2 points: 1. Change packaging to pom, indicating that it is a parent collection 2. Introduce the parent node as our springboot, here is to set the springboot-related dependencies and version control of the entire project from the above, after the node sets version to 2.2.0.RELEASE, all the following group dependencies for org.springframework.boot do not display the setting version information.

Create child module

In the same process as creating a parent project, create the child modules we need to use in turn, as shown below:

After the above steps, I believe you have been able to create the architectural environment needed for our project.

After reading the above, have you mastered the introduction of the preface of springboot to develop a single web shop and the method of building the environment? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report