lowols Java Development Notes

website·Indexed 30 days ago

https://lowols.github.io

A comprehensive collection of Java development tutorials and notes covering JavaWeb (HTML, CSS, JavaScript, Servlet, Tomcat 10), Spring Framework (IoC, DI, AOP, Spring MVC), and the SSM stack. It includes guides on data persistence with JDBC and MybatisPlus, microservices architecture using SpringCloud, Sentinel, and Gateway, as well as infrastructure and middleware such as Redis, RabbitMQ, Elasticsearch, and Docker.

Tokens
266.7K
Snippets
942
Records
1.4K
Agent score
72%

What's inside lowols

  1. Overview of MySQL Logical Architecture

    MySQL follows a Client/Server (C/S) architecture where the server process is mysqld. The system is logically divided into three primary layers:

    1. Connection Layer: Handles TCP connections, user authentication, permission verification, and connection management via a thread pool.
    2. Service Layer (SQL Layer): Provides core services including the SQL Interface, Parser, Optimizer, and Caches/Buffers. It is independent of the underlying storage format.
    3. Engine Layer (Storage Engines): A pluggable layer responsible for the actual storage and retrieval of data from the physical server. It communicates with the Service Layer via APIs.
  2. Overview of Front-end Engineering and Recommended Tech Stack

    Front-end Engineering applies software engineering methods to solve issues regarding modularity, componentization, standardization, and automation in the front-end development process to improve efficiency and reduce costs. A recommended modern technical stack for implementation includes:

    • ECMAScript 6 (ES6): Core syntax used extensively in Vue 3.
    • Node.js: The runtime environment for front-end projects.
    • npm: Dependency management tool.
    • Vite: Project build tool.
    • Vue 3: Progressive front-end framework.
    • Vue Router: Handles page navigation/routing.
    • Pinia: State management for data sharing between components.
    • Axios: Library for asynchronous HTTP requests to interact with back-end APIs.
    • Element-plus: Component library for rapid UI construction.
  3. Overview of Spring MVC Request Processing Architecture

    Spring MVC relies heavily on the Strategy and Adapter patterns to maintain flexibility in request handling:

    • HandlerMapping: Determines which handler (e.g., a @RequestMapping method) should process a request. RequestHandlerMapping manages a registry of HandlerMethod objects.
    • HandlerAdapter: Adapts the execution of various handler types. RequestMappingHandlerAdapter specifically handles HandlerMethod execution, performing two key tasks:
      • Parameter Resolution: Uses HandlerMethodArgumentResolver strategies to convert HTTP request data into method arguments.
      • Return Value Handling: Uses HandlerMethodReturnValueHandler strategies to process the method's return value (e.g., converting a Java object to JSON).
  4. Overview of the Spring Ecosystem

    Spring is not a single technology but a family of projects that form a comprehensive ecosystem for developing Web applications, microservices, and distributed systems. The three most critical projects are:

    • Spring Framework: The foundation of the entire ecosystem and the core technology upon which other Spring projects are built.
    • Spring Boot: Built on top of Spring Framework to simplify the integration of third-party frameworks and accelerate development.
    • Spring Cloud: Specifically designed for developing microservices architectures.

    Other notable projects include Spring Data and Spring Security.

  5. Overview of JDBC Architecture

    JDBC (Java Database Connectivity) is a standard Java API (java.sql, javax.sql) that provides a unified way to access various relational databases regardless of the specific database management system. It follows an interface-based programming model where Java defines the standard interfaces and database vendors provide the concrete driver implementations. The architecture consists of two layers: the Application API (used by developers to execute SQL and manage connections) and the Driver API (used by vendors to implement the drivers).
  6. Overview of Java Program Flow Control

    Program flow control determines the execution order of code in Java. There are three primary structures:

    1. Sequential Structure: The default behavior where code executes from the main method downwards in order.
    2. Branching Structure: Executes specific blocks of code based on whether a condition is true or false. Java provides if and switch statements for this purpose.
    3. Looping Structure: Repeats a block of code multiple times. Java provides for, while, and do-while loops.
  7. Overview of Redis features

    Redis (Remote Dictionary Server) is an in-memory, key-value NoSQL database. Its primary characteristics include:

    • Key-Value Store: Supports various data structures for values (strings, numbers, JSON, etc.).
    • Performance: Low latency and high speed due to being memory-based, using IO multiplexing and efficient encoding.
    • Concurrency: Single-threaded architecture ensuring that each command is atomic.
    • Availability & Scalability: Supports data persistence, master-slave clusters, and sharding clusters.
    • Compatibility: Supports multi-language clients.
  8. Overview of the ELK Stack

    The ELK stack is a collection of open-source tools used for log collection, system monitoring, and status analysis. It consists of:

    • Elasticsearch: The core engine used for data storage, computation, and search.
    • Logstash/Beats: Tools used for data collection and ingestion.
    • Kibana: A visualization layer for searching, aggregating, and monitoring Elasticsearch data.
  9. Overview of JavaWeb Listener interfaces

    Listeners implement the Observer pattern to handle events related to the three main scope objects (Application, Session, and Request). They are categorized by the object they monitor and the type of event they track:

    • Application Scope: ServletContextListener (lifecycle), ServletContextAttributeListener (attributes).
    • Session Scope: HttpSessionListener (lifecycle), HttpSessionAttributeListener (attributes), HttpSessionBindingListener, HttpSessionActivationListener.
    • Request Scope: ServletRequestListener (lifecycle), ServletRequestAttributeListener (attributes).
  10. Overview of HTTP Protocol versions and features

    The HyperText Transfer Protocol (HTTP) defines the rules for communication between browsers (clients) and web servers using request and response messages.

    • HTTP/1.0: Introduced status codes, HTTP headers, and support for documents other than HTML. Supported GET, HEAD, and POST.
    • HTTP/1.1: The first standardized version. Introduced virtual hosting (multiple domains per IP), persistent connections (keep-alive), and caching. Supports OPTIONS, GET, HEAD, POST, PUT, DELETE, and TRACE.
    • HTTP/2: Focused on performance and latency. Key features include:
      • Multiplexing: Multiple requests/responses over a single connection.
      • Binary Framing: Uses binary instead of text for faster parsing.
      • Header Compression (HPACK): Reduces data overhead.
      • Server Push: Allows servers to push resources to clients before they are requested.
    • HTTP/3: Replaces TCP with the QUIC protocol to improve speed, reliability, and security across all device types.
  11. Overview of specialized MySQL storage engines

    MySQL provides several specialized engines for specific use cases:

    • Archive: Used for data archiving (optimized for inserts, not updates/deletes).
    • Blackhole: Discards all write operations and returns empty results for reads.
    • Federated: Acts as a proxy to access tables on remote MySQL servers (disabled by default).
    • Merge: Manages a collection of MyISAM tables as a single entity.
    • NDB (NDB Cluster): Used for MySQL Cluster distributed environments, similar to Oracle RAC.