原创 佔位符解析

佔位符解析過程 佔位符解析器 /** * 從指定的屬性源中,將佔位符解析爲具體的值 */ public class PropertyPlaceholderHelper { private static final Log lo

原创 RequestMapping 註解的解析、匹配、註冊

RequestMapping 註解的解析、匹配、註冊 1)創建 RequestMappingHandlerMapping 實例時會觸發 afterPropertiesSet 調用。 2)讀取容器中所有帶有 Controller 或 Requ

原创 構建與衆不同的軟件

構建與衆不同的軟件 Behavior Driven Development【行爲驅動開發】是一種軟件設計思想,用於實現更快地構建和交付有價值、 高質量的軟件。 BDD from 50000 feet 傳統的軟件開發流程 1)客戶人員告訴

原创 BDD Cucumber 實戰

cucumber cucumber 是一個用於執行 BDD 的自動化測試工具。 用戶指南 創建 Spring Boot 項目並引入依賴 <?xml version="1.0" encoding="UTF-8"?> <project xm

原创 緩存模式【其他模式】

緩存模式 public class Cache { /** * Caching Pattern【緩存模式】 * readThrough:先嚐試從緩存中讀取數據,如果存在,則直接返回緩存中的數據;如果不存在,則從數

原创 Lombok 註解簡介

Lombok @AllArgsConstructor /** * 生成一個包含所有屬性的構造函數 */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) pub

原创 依賴注入模式【其他模式】

@SuppressWarnings("boxing") public class DependencyInjection { /** * Dependency Injection Pattern【依賴注入模式】:保持軟件組

原创 服務定位器【其他模式】

服務定位器 public class ServiceLocator extends Object { private static final String ZOOKEEPER_SERVICE = "zookeeperService

原创 規範模式【其他模式】

規範模式 @Slf4j public class Specification { /** * 規範模式: * Specification pattern separates the statement of ho

原创 原型繼承模式【其他模式】

原型模式 public class Property { /** * Property Pattern【原型繼承模式】 */ @Test public void all() {

原创 限流模式【其他模式】

限流模式 @Slf4j public class Throttling { /** * 限流模式: * Ensure that a given client is not able to access serv

原创 單態模式【其他模式】

單態模式 public class MonoState { /** * MonoState pattern【單態模式】 * all instances of the class will have the sam

原创 事件溯源【其他模式】

事件溯源 @Slf4j public class EventSourcing { /** * 事件溯源模式: * Instead of storing just the current state of the

原创 Promise【其他模式】

Promise @Slf4j public class Promise { /** * Promise Pattern【承諾】:承諾表示當前還未完成,但是會在將來完成的操作,用於實現異步計算。 */ @T

原创 流暢接口【其他模式】

流暢接口 @Slf4j @SuppressWarnings("boxing") public class FlentInterface { /** * Fluent Interface pattern【流暢接口】:能夠提供