Software Engineering Curriculum Design · SOA Architecture Build an online mall system with SSM framework

Software Engineering Curriculum Design · SOA Architecture Build an online mall system with SSM framework

Project Description

This system uses SSM framework, Dubbo framework, Maven modular development and other technologies to develop an online mall project, which mainly includes order system module, shopping cart system module, search system module, background management system module, etc., to achieve a complete online Shopping system.

Project

The project engineering and its corresponding introduction are shown in Figure 1 and Table 2.
Figure 1 Project Drawing
Insert picture description here
Table 2

Project Related introduction
commons Store Cookies, HttpClient and other tools
parent Parent project
sing Entity class
service Service interface
service-impl producer of dubbo
manage Backend project
order Order module
passport SSO single sign-on module
repeat Cache module
search Search module

Project Flow

See the figure below for the project Flow

Project Flow Diagram
Insert picture description here

System related technology introduction

Technical selection:

Backend framework: Spring, SpringMVC, MyBatis

Front-end technology: JSP, jQuery, EasyUI

Database: Redis, MySQL

Server: Tomcat, Nginx

Service scheduling: Dubbo

Cross-domain technology: Jsonp, HttpClient

SOA architecture (Service Oriented Architecture)

"Service-oriented architecture": It is a design method that contains multiple services, and the services ultimately provide a series of functions through interdependence. A service usually exists in an independent form with the operating system process. The various services are called through the network.
Schematic diagram of SOA architecture
Insert picture description here

SOA architecture description

The repetitive functions or modules are extracted into the form of components to provide external services, and the ESB (Enterprise Service Bus) form is used as a communication bridge between projects and services.

Advantages of SOA architecture

Repetitive functions or modules are extracted as services to improve development efficiency. ​High reusability. High maintainability.

Disadvantages of SOA architecture

The business of each system is different, it is difficult to confirm that the functions or modules are duplicated. The granularity of extracting services is large. There is a high degree of coupling between the system and the service.

SOA architecture achieves high concurrency

Each sub-module in the SOA architecture is a project and can be deployed independently. High concurrency can be easily achieved by deploying the project to different servers. Therefore, the SOA architecture can be said to be born to solve high concurrency.

ESB (Enterprise Service Bus)

Simply put, the ESB is a pipe used to connect various service nodes. In order to integrate services of different systems and different protocols, ESB has done message translation, interpretation and routing work, so that different services can be interconnected.

Dubbo frame

Apache Dubbo is a high-performance Java RPC framework. Its predecessor is a high-performance, lightweight open source Java RPC (remote procedure call) framework open sourced by Alibaba, which can be seamlessly integrated with the Spring framework.

Dubbo architecture diagram (officially provided by Dubbo)
Insert picture description here

node Role Name
Provider Service provider that exposes the service
Consumer Service consumer calling remote service
Registry Registry for service registration and discovery
Monitor Monitoring center that counts the number of service calls and call time
Container Service running container

– Dotted lines are asynchronous accesses, solid lines are synchronous accesses
– Blue dotted lines: functions completed at startup
– Red dashed lines (solid lines) are functions executed during program operation

Call relationship description:

  1. The service container is responsible for starting, loading, and running the service provider.
  2. When the service provider starts, it registers the service it provides with the registration center.
  3. When a service consumer is started, he subscribes to the registry for the service he needs.
  4. The registration center returns the list of service provider addresses to the consumer. If there is a change, the registration center will push the change data to the consumer based on the long connection.
  5. Service consumers, from the provider address list, based on the soft load balancing algorithm, select one provider to call, and if the call fails, select another to call.
  6. Service consumers and providers accumulate the number of calls and call time in the memory, and send statistical data to the monitoring center every minute.

Introduction to Zookeeper

Zookeeper is a sub-project of Apache Hadoop. It is a tree-type directory service that supports change pushes. It is suitable as a registration center for Dubbo services. It has high industrial strength and can be used in production environments and is recommended. Dubbo officially recommends using Zookeeper as the service registration center.

Zookeeper tree directory service diagram
Insert picture description here
Process description:

  • When the service provider (Provider) Start: to /dubbo/com.foo.BarService/providerswrite their own URL address directory
  • Service consumers (Consumer) startup: Subscribe /dubbo/com.foo.BarService/providersprovider directory URL address. And /dubbo/com.foo.BarService/consumerswrite their own URL address directory
  • When monitoring center (Monitor) Start: Subscribe to /dubbo/com.foo.BarServiceall providers and consumers URL address directory

Introduction to maven

Maven is a project management tool whose main function is to perform dependency management and project construction on Java projects during the project development phase. Among them, dependency management is the management of jar packages. By importing maven coordinates, it is equivalent to importing the jar package in the warehouse into the current project. Project construction is to complete the entire process of cleaning, compiling, testing, reporting, packaging, and deployment of the project through a single command of maven.

MySQL

MySQL is a relational database management system. Relational databases store data in different tables. SQL language is used to access the database. Due to its small size, high speed, and low cost, especially the characteristics of open source, small and medium-sized websites are generally used. All of the developers choose MySQL as the website database.

Redis

Redis database is a cache database, used to store frequently used data, so as to reduce the number of access to the database and improve operating efficiency. Redis actually means that the frequently accessed records in the table are placed in Redis, and then when users query, they first query Redis and then query MySQL. It does realize the separation of read and write, that is, Redis only performs read operations. Since the cache is in memory, the query will be fast.

Redis example diagram
Insert picture description here

Cross-domain technology

Cross-domain: A project in a servlet container (tomcat) calls a project in another servlet container (tomcat), which is called cross-domain.
The reason: ajax in research and development in the security considerations do not allow cross-domain requests.
Solution 1: Use jsonp.
Solution 2: The project accesses its own controller, its own controller accesses its own service, and uses httpclient in its own service to call another project's controller method.
The difference between the two is shown in the table below
Insert picture description here

Project introduction and effect display

Portal module

The portal module mainly contains the homepage of the online shopping mall system, which includes login and registration, product classification, various modules and quick access to products. The latest and hottest product recommendations of the mall are also displayed here. Users can browse and purchase directly on the homepage. The specific effect is shown in Figure 2 below.
Figure 2 Portal module diagram
Insert picture description here

Shopping Cart Module

The shopping cart module mainly contains the shopping cart page of the online shopping mall system. Users can add their favorite items to the shopping cart for the next selection. In the shopping cart module, users can delete products, modify the number of products, and perform settlement operations. The specific effect is shown in Figure 3 below.
Figure 3 Shopping cart module diagram
Insert picture description here

Commodity module

The product module mainly includes the product display page of the online shopping mall system. Users can view the specific parameters of the product on this page, such as price, performance and product pictures. If they like, users can also add to the shopping cart, share with friends, and so on. The specific effect is shown in Figure 4 below.
Figure 4 Commodity module diagram
Insert picture description here

Background module

The background module mainly includes the background management page of the online shopping mall system. The administrator can manage users and products on this page, and can add, delete, modify, and check operations on this page. The specific effect is shown in Figure 5 below.
Figure 5 Background module diagramInsert picture description here

Order module

The order module mainly includes the order page of the online shopping mall system. The user comes to this page when submitting a purchase to complete the consignee information and select the payment method and delivery method. After completing the above information, you can submit the purchased product. The specific effect is shown in Figure 6 below.
Figure 6 Order module diagram
Insert picture description here

Project summary

This system uses SOA framework to realize the online shopping mall system. The SOA architecture takes advantage of its oriented enterprise business process, better adaptability and scalability, component and interoperability, shared resources, high concurrency, easy maintenance, etc., when developing large-scale projects with high concurrency similar to online shopping malls , Has a unique advantage. In addition to online shopping malls, some online chat systems, blog sites, etc. can also use SOA architecture and microservice architecture to solve problems such as high concurrency after users reach a certain level.

Source code and its interpretation file

Provide free source code
https://download.csdn.net/download/zjlwdqca/13621359

Insert picture description here

Guess you like

Origin blog.csdn.net/zjlwdqca/article/details/110949919