ssm (Spring, Springmvc, Mybatis) Taobao Shop - Day 1

Posted by icesolid on Sat, 11 May 2019 06:38:50 +0200

outline

1. Course introduction
2. Basic introduction of Taotao Shop
3. Background management system engineering structure and construction
4. svn Code Management
5. Project Source and Data Download
6. Reference Articles

 

1. Course introduction

1. Course Outline

A total of 14 days
(1) Day 1: Background of E-commerce industry.Introduction of Taotao Shop.Build project projects.Use of Svn.
(2) Next day: framework integration.Background management commodity list implementation.Paging plug-in.
(3) Day 3: Background management.Goods added.Goods category selection, picture upload, use of rich text editor.
(4) Day 4: Realization of commodity specifications.
(5) Fifth day: the establishment of the foreground system of the store.Display of commodity classification on the first page.Jsonp.
(6) Day 6: Implementation of the cms system.Display of large front advertising space.
(7) Day 7: The cms system adds cache.Redis.Cache synchronization.
(8) Day 8: Implementation of search function.Use solr for search.
(9) Day 9: Display of the commodity details page.
(10) Day 10: Single sign-on system.Session Sharing.
(11) Day 11: Implementation of shopping cart order system.
(12) Day 12: nginx.Reverse proxy tool.
(13) Day 13: the establishment of redis cluster and solr cluster.Deployment of the system.
(14) Project summary.

2. Today's Course

(1) Background of e-commerce industry.
(2) Introduction of Taobao Shop.
(3) Construction of the project.
(4) Use of svn.

2. Basic introduction of Taotao Shop

1. Technical features of e-commerce industry

New Technology
Wide range of technologies
_Distributed
High concurrency, clustering, load balancing, high availability
Mass data
Business Complexity
System Security

2. Introduction to Taotao Shop

Taotao Online Shop is a comprehensive B2C platform, similar to Jingdong Shop and Tmall Shop.Members can browse the store, place orders, and participate in various activities.
_Administrators and operators can manage commodities, orders, members and so on in the platform background management system.
_Customer service can handle user inquiries and complaints in the background management system.

3. Functional Architecture

3.1 System Function Diagram

 

3.2 Functional Description
_Background management system: manage commodities, orders, categories, commodity specifications and attributes, user management and content publishing functions.
_Foreground system: Users can register, log on, browse goods, home page, order and other operations in the foreground system.
Membership system: Users can inquire about orders placed, collections, my coupons, group purchases, etc. in this system.
_Order system: provide order placing, query order, modify order status, process order regularly.
_Search system: Provides the search function for goods.
_Single sign-on system: Provides user login credentials and queries logged-on user information between multiple systems.

4. Technical Architecture

4.1 Traditional Architecture

 

Think: What's wrong?
1. The coupling between modules is too high, one of them has to be upgraded and the others have to be upgraded.
2. Development difficulties, each team should be integrated in the end
3. Poor scalability of the system
4. Distributed deployment is not flexible.

4.2 Distributed System Architecture

 
 
Project Final Architecture

Distributed architecture:
The system is divided into subsystems by module.
Advantage:
1. Split the modules and use interface communication to reduce the coupling between modules.
2. Split the project into subprojects, with different teams working on different subprojects.
3. When adding functions, you only need to add one more subproject and call the interface of other systems.
4. Flexible and distributed deployment.

Disadvantages:
Interaction between systems requires remote communication, and interface development adds workload.

5. Project Technology Selection

_Spring, Spring MVC, Mybatis (Key Master)
JSP, JSTL, jQuery, jQuery plugin, EasyUI, KindEditor (Rich Text Editor), CSS+DIV (Know it)
Redis (Cache Server, Focus)
Solr (Search, Focus)
_httpclient (call system services, focus)
Mysql (Key Master)
_Nginx (web server, focus)

6. Development tools and environments

idea
Maven 3.5
Tomcat 8.5.3
JDK 1.8
Mysql 5.7
Nginx 1.8.0
Redis 3.0.0
Win8 Operating System
SVN (Version Management)

3. Background management system engineering structure and construction

1. Maven Foundation

Maven capabilities include dependency management, project building, and project aggregation.The types of projects include pom, jar, war. Refer to the article for specific functions: https://www.cnblogs.com/WUXIAOCHANG/p/10784540.html

2. Maven Use of Background Projects in Taobao Shop

2.1 pom Project
(1)taotao-parent:
_taotao-parent is the parent project of the entire project, it is a pom project.Version control for the entire project, where all versions of the jar packages to be used in the project are centrally managed by the parent project.This way you don't need to write a version number when writing maven dependencies in other project pom files.Of course, all projects must inherit it first.
(2)taotao-manager:
_Create taotao-manager for aggregation engineering, which is also a pom project.Create four model s, taotao-manager-pojo,taotao-manager-dao,taotao-manager-service,taotao-manager-web, and automatically generate four separate maven projects.Aggregation projects are just tools to help other modules build, and they don't have much in themselves.Specifically, each project code is written in the generated project.
_The meaning of using the aggregation project, taotao-manager, is that these modules were originally separate projects, but now they are aggregated into taotao-manager, so that when we build a project, we only need to build one taotao-manager.We just use maven to build this aggregation project, taotao-manager, without worrying about building modules, such as install taotao-manager.All in all, simplify the operation.Normal coding is done in the corresponding taotao-manager-pojo,taotao-manager-dao,taotao-manager-service,taotao-manager-web.In the project.
2.2 war Project
(1) taotao-rest, taotao-portal these
_These projects are all deployed on the server, so they are packaged as war s.Some of these projects are directly accessed by users through browsers, or invoked by other projects by publishing services.
2.3 jar Project
(1)taotao-common
_This is the project packaged into jar.It is simply a class, a tool class, that is used by other projects.We can reference it in the pom files of other projects, just like other jar packages.

3. Project structure built by Maven

 

4. Code Actual

4.1 Configure the maven address for idea

 
 

4.2 Create a taotao-parent project
_taotao-parent is the parent of the entire mall, defining the versions on which each maven depends and configuring the tomcat plug-in and jdk versions without writing any actual code

 
 
 
 

The project structure after creation is as follows

 

Modify the pom.xml file code as follows:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.wxc</groupId>
    <artifactId>taotao-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <!--1.pom Project: Used in parent or aggregate projects.used to jar Version control of packages.
        2.war Project: will be packaged into war,Projects published on the server.Such as a website or service.
        3.jar Project: will be packaged into jar Be used as jar Package usage.-->
    <packaging>pom</packaging>

    <!-- Centrally Define Dependent Version Numbers -->
    <properties>
        <junit.version>4.12</junit.version>
        <spring.version>4.1.3.RELEASE</spring.version>
        <mybatis.version>3.2.8</mybatis.version>
        <mybatis.spring.version>1.2.2</mybatis.spring.version>
        <mybatis.paginator.version>1.2.15</mybatis.paginator.version>
        <mysql.version>5.1.32</mysql.version>
        <slf4j.version>1.6.4</slf4j.version>
        <jackson.version>2.4.2</jackson.version>
        <druid.version>1.0.9</druid.version>
        <httpclient.version>4.3.5</httpclient.version>
        <jstl.version>1.2</jstl.version>
        <servlet-api.version>2.5</servlet-api.version>
        <jsp-api.version>2.0</jsp-api.version>
        <joda-time.version>2.5</joda-time.version>
        <commons-lang3.version>3.3.2</commons-lang3.version>
        <commons-io.version>1.3.2</commons-io.version>
        <commons-net.version>3.3</commons-net.version>
        <pagehelper.version>3.4.2-fix</pagehelper.version>
        <jsqlparser.version>0.9.1</jsqlparser.version>
        <commons-fileupload.version>1.3.1</commons-fileupload.version>
        <jedis.version>2.7.2</jedis.version>
        <solrj.version>4.10.3</solrj.version>
    </properties>

    <!--Define versions without adding actual dependencies-->
    <dependencyManagement>
        <dependencies>
            <!-- Time Operation Component -->
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${joda-time.version}</version>
            </dependency>
            <!-- Apache Tool Components -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-net</groupId>
                <artifactId>commons-net</artifactId>
                <version>${commons-net.version}</version>
            </dependency>
            <!-- Jackson Json Processing Toolkit -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <!-- httpclient -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
            </dependency>
            <!-- unit testing -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test

Topics: Java Maven Mybatis Apache Spring