SpringCloud GateWay custom filter GatewayFilter and AbstractGatewayFactory

1. GatewayFilter GatewayFilter is a simple interface used to define the behavior of a gateway filter. A gateway filter is a class that implements the GatewayFilter interface and can perform certain operations when a request enters the gateway or when a response leaves the gateway. Filters can be used to modify requests or responses, log, […]

Refactor Android asynchronous code using promises

Author: Wushan Old Demon Background Writing Android asynchronous tasks in business has always been a challenge. The previous callback and thread management methods were complex and cumbersome, making the code difficult to maintain and read. JavaScript actually faces the same problem in the front-end field, and Promise is one of its more mainstream solutions. Before […]

Refactor Android asynchronous code using promises

Background Writing Android asynchronous tasks in business has always been a challenge. The previous callback and thread management methods were complex and cumbersome, making the code difficult to maintain and read. JavaScript actually faces the same problem in the front-end field, and Promise is one of its more mainstream solutions. Before trying to use Promise, […]

Solving errors in web projects, java.io.FileNotFoundException: druid.properties (the system cannot find the specified file); [spring factory decoupling development]

When using Tomcat9.0, spring5.0 framework original factory class decoupling, druid-1.0.9jar version, JDK9, MSQL8 version database to simulate web page login case, an error message that the druid.properties file cannot be found appears, the details are as follows [Case code posted at the end]; Normally speaking, the configuration file is placed under the src directory, and […]

factory design pattern

Article directory 1. Simple Factory Pattern & Static Factory Pattern 2. Factory method pattern 3. Abstract Factory Pattern Illustrations from: https://refactoringguru.cn/design-patterns/catalog 1. Simple factory pattern & amp; static factory pattern Simple Factory Pattern Strictly speaking, it is not a design pattern, but more like a programming habit. The simple factory pattern does not expose the […]

Simple factory vs factory method

Factory method pattern – no need to know manufacturing details The simple factory pattern was introduced earlier. The simple factory pattern is just the most basic design pattern related to creating instances. In real situations, there are more complex situations to deal with. A class that generates instances from a simple factory knows too many […]

The principle of Spring Boot spring.factories

Article directory 1. spring.factories usage 2. spring.factories implementation principle 3. What problems is spring.factories used to solve? 3.1 Business scenario thinking and introduction of starter mechanism 3.2 Spring Boot starter mechanism 4. Summary Recently, I saw the configuration of spring.factories being used in business code, and felt that the scenario was inappropriate. Moreover, there are […]

Mybatis integrates pagehelper and reports an error ClassNotFoundException: org.mybatis.logging.LoggerFactory

Table of Contents Report an error reason Solution Error report In order to introduce pagehelper, the following code is added to the pom.xml file <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.1.3</version> </dependency> As a result, the error when starting the soringboot project is as follows: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘testMybatisController’: Unsatisfied dependency expressed through field ‘salePickGoodsInfoMapper’; […]

Code Refactoring: The Art and Practice of Improving Software Quality

Directory title 1. Introduction 1.1 Importance of Refactoring 1.2 Goals of Refactoring 2. Preparation Before Refactoring 2.1 Ensuring Code Quality 2.2 Establishing a Robust Test Suite 3. The Refactoring Process 3.1 Making Small Changes 3.1.1 Why modify in small steps? 3.1.2 How to make small-step modifications? 3.2 Using Version Control 3.2.1 The Importance of Version […]