Feixiang Java Design Patterns and Quartz Tutorials
website·Indexed 30 days ago
https://feixiang.netA collection of technical guides covering Java behavioral and structural design patterns—including Strategy, Command, Observer, and Decorator patterns—alongside comprehensive Quartz scheduler tutorials featuring 15 practical examples on job execution, clustering, and trigger management.
What's inside Feixiang
- The Singleton Pattern is a creational design pattern that ensures a class has only one instance and provides a global point of access to it. It is primarily used for resource optimization (e.g., database connection pools), global access to shared resources, and controlling instance creation for critical business logic. Common scenarios include printer/thread pool sharing, system configuration management, centralized logging, and cache management.
Overview of Redis features and capabilities
Redis (Remote Dictionary Server) is a high-performance, in-memory NoSQL database. It is designed for high-concurrency scenarios and provides the following core characteristics:
- High Performance: Capable of handling hundreds of thousands of read/write operations per second due to its in-memory nature.
- Diverse Data Types: Supports strings, hashes, lists, sets, and sorted sets.
- Atomicity: All operations are atomic, ensuring data consistency and integrity in concurrent environments.
- Persistence: Supports saving in-memory data to disk to prevent data loss after system restarts.
- Pub/Sub: Built-in publish/subscribe mechanism for real-time messaging and communication between clients.
- Single-Threaded Model: Uses an efficient event-driven model to handle concurrent requests while simplifying concurrency control.
- Replication: Supports master-slave replication for data backup and read scaling.
Overview of MySQL XA Transactions
XA transactions are based on the X/Open XA specification for distributed transactions. They allow a Transaction Manager (TM) to coordinate multiple Resource Managers (RM), such as multiple MySQL instances or heterogeneous databases, to ensure that a distributed transaction either completes entirely or rolls back completely (atomicity). In this architecture, MySQL acts as the Resource Manager. XA transactions are only supported by the InnoDB storage engine in MySQL 5.7+.Overview of the Interpreter Design Pattern
The Interpreter pattern is a behavioral design pattern used to define a grammar for a language and provide an interpreter to evaluate expressions within that language. It decomposes complex syntax into simple grammar units and uses recursive composition to build an Abstract Syntax Tree (AST), which is then executed layer by layer.
Key Benefits:
- Structural Parsing: Breaks complex syntax into simple units for structured analysis.
- Separation of Concerns: Decouples syntax parsing logic from business operations, adhering to the Single Responsibility Principle.
- Extensibility: New expression types can be added by creating new interpreter classes without modifying existing code (Open-Closed Principle).
When to use:
- When interpreting domain-specific languages (DSLs) such as mathematical formulas, regular expressions, SQL queries, or configuration files.
- When the grammar is relatively simple and stable. For highly complex grammars (e.g., nested loops, complex control flows), parser generators like ANTLR are recommended.
- When dynamic extension of grammar rules is required.
Overview of Redis Unordered Sets
Redis Sets are unordered collections of unique strings. They automatically handle deduplication, meaning duplicate elements are ignored during insertion. They are ideal for scenarios requiring fast membership checks or set operations (intersection, union, difference). Key characteristics include O(1) time complexity for adding, removing, and querying elements, and the lack of a fixed order (elements cannot be accessed by index).Overview of Maven Private Repositories (Private Servers)
A private repository (often called a 'Private Server' or '私服') is an internal remote repository controlled by an organization's IT department. It serves as a buffer between developers and the public internet, providing three primary functions: hosting private artifacts, proxying external repositories, and aggregating multiple repositories into a single entry point. Common industry products include Sonatype Nexus Repository, JFrog Artifactory, and Apache Archiva.Overview of File Upload and Exception Handling in Spring MVC
Spring MVC provides a set of tools to handle file transfers and system errors. Key objectives include implementing secure and efficient file uploads/downloads and building a unified exception response mechanism to prevent raw stack traces from being exposed to the client.Overview of Bear note-taking app
Bear is a focused note-taking application for macOS and iOS that emphasizes a streamlined experience with tags, search, and synchronization. It features a hybrid editor that allows users to see both Markdown syntax and formatted text simultaneously.Overview of the Quartz Job Scheduling Library
Quartz is a feature-rich, open-source job scheduling library for Java applications, ranging from small standalone apps to large e-commerce systems. It allows developers to create simple or complex schedules to execute thousands of jobs. Jobs are defined as standard Java components that can be programmed to perform any specific action. The scheduler includes enterprise-level features such as support for JTA transactions and clustering. Quartz is licensed under the Apache 2.0 license.Overview of Redis String data type
Redis Strings are the most basic data structure in Redis. They are binary-safe, meaning they can store any sequence of bytes, including plain text, serialized objects (JSON, Protobuf), integers, floating-point numbers, and binary data (like small images). The maximum size for a single String value is 512MB. Key characteristics include atomic operations, support for numerical calculations, flexible expiration (millisecond/second precision), and bit-level manipulation.Overview of iA Writer Markdown Editor
iA Writer is a cross-platform Markdown editor available for macOS, Windows, iOS, and Android. It is known for its 'Focus Mode', which centers the current sentence to minimize distractions. The application allows exporting Markdown files to HTML, PDF, and Microsoft Word formats using custom templates.Overview of Marked 2 Markdown Previewer
Marked 2 is a macOS-exclusive application designed for previewing (not editing) Markdown files. It acts as a standalone desktop renderer, allowing users to drag and drop Markdown files onto the app icon to see the rendered result. It is particularly useful for developers using editors without built-in previewers (such as Vim) by providing a real-time side-by-side preview window.