Sloving Knowledge Base

website·Indexed 31 days ago

https://sloving.top/

A personal knowledge base featuring technical guides on Java development (Spring, Spring Boot, SpringMVC, MyBatis, SSM framework), LeetCode algorithm solutions, and articles on personal finance, asset allocation, and life reflections.

Tokens
243.4K
Snippets
862
Records
1.4K
Agent score
61%

What's inside Sloving

  1. Overview of the SSM Framework Stack

    The SSM framework is a lightweight and flexible JavaWeb development stack consisting of Spring, SpringMVC, and MyBatis. It is designed to simplify the development process, improve efficiency, and provide a stable, secure foundation for web projects, particularly those with simple data sources. It serves as a modern alternative to the older SSH (Struts+Spring+Hibernate) stack.
  2. Overview of Linux and its common distributions

    Linux is a free, open-source, Unix-like operating system based on POSIX. It is a multi-user, multi-tasking system supporting multiple threads and CPUs, designed with a network-centric architecture. It is widely used in server environments and development. Common distributions (which bundle the Linux kernel with application software) include Ubuntu, RedHat, CentOS, Debian, Fedora, SuSE, OpenSUSE, Arch Linux, and SolusOS. Kali Linux is specifically noted for its use in security penetration testing.
  3. Overview of Elasticsearch and the ELK Stack

    Elasticsearch is an open-source distributed search engine used for full-text search, log statistics, analysis, and system monitoring. It is the core of the Elastic Stack (ELK), which consists of Elasticsearch (storage, search, and analysis), Logstash (data processing), Kibana (visualization), and Beats (lightweight data shippers). Unlike its underlying library Lucene, Elasticsearch provides a RESTful API and supports horizontal scaling for distributed environments.
  4. Overview of MyBatis Dynamic SQL

    Dynamic SQL in MyBatis allows the generation of different SQL statements based on varying query conditions. This eliminates the need for manual string concatenation in Java, which is error-prone due to spacing and comma management. MyBatis uses OGNL expressions to evaluate conditions within XML tags.
  5. Overview of Spring Boot Testing Strategies

    Spring Boot Test provides three primary testing categories based on the scope and isolation of the test:

    1. Unit Testing: Focuses on individual methods. High cost to implement for every method; best suited for complex logic with few external dependencies. Uses @Test.
    2. Slice Testing: Targets boundary functions that are difficult to test in isolation. Sits between unit and functional testing. Uses annotations like @WebMvcTest.
    3. Functional Testing: Focuses on complete business features (e.g., a Controller or public Service) within a single JVM, mocking most external dependencies. This is the recommended approach for core business logic. Uses @SpringBootTest.
  6. Overview of the Java Collections Framework

    The Java Collections Framework is located in the java.util package. It is rooted in two primary interfaces: Collection and Map.

    • Collection: A group of objects that can allow duplicates. It branches into List and Set.
    • Map: A mapping of key-value pairs. It is distinct from the Collection interface and does not inherit from it.

    Key categories:

    • List: Ordered collections that allow duplicate elements and support index-based access.
    • Set: Unordered collections that prohibit duplicate elements.
    • Map: Key-value pairs where values are accessed via their unique keys.
  7. Overview of the Spring Framework

    Spring is a lightweight, open-source Java framework designed as a one-stop (full-stack) solution for enterprise application development. It focuses on reducing the complexity of J2EE development by providing a thin wrapper around difficult Java EE APIs (such as JDBC and Java Mail) and integrating seamlessly with other frameworks like MyBatis, Hibernate, and Quartz. Its core architecture is built upon Inversion of Control (IoC) and Aspect-Oriented Programming (AOP).
  8. Overview of HttpServletRequest and HttpServletResponse

    In Java Servlet development, HttpServletRequest and HttpServletResponse are used to handle the communication between the client (browser) and the server (e.g., Tomcat).

    • HttpServletRequest: Used to retrieve data sent by the client. Tomcat parses the incoming HTTP request (request line, headers, and body) and encapsulates it into this object.
    • HttpServletResponse: Used to define the data the server sends back to the client. The developer populates this object, and Tomcat converts it into a valid HTTP response format (status line, headers, and body).
    @WebServlet("/demo3")
    public class ServletDemo3 extends HttpServlet {
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // Retrieve data from request
            String name = request.getParameter("name");
    
            // Set response data
            response.setHeader("content-type", "text/html;charset=utf-8");
            response.getWriter().write("<h1">" + name + ", welcome!</h1>");
        }
    }
  9. Overview of Redis and NoSQL characteristics

    Redis is an open-source, memory-based, key-value store written in ANSI C that supports multiple data structures, networking, and optional persistence. It is a prominent example of NoSQL (Not Only SQL) databases, which are designed to overcome the I/O bottlenecks of relational databases (RDBMS) in high-concurrency environments.

    Key characteristics of NoSQL databases include:

    • Scalability: Easy to extend and decouple as data lacks rigid relational constraints.
    • High Performance: Capable of handling massive data volumes with low latency (e.g., Redis can perform ~80k writes and ~110k reads per second).
    • Schema Flexibility: Supports diverse data types (Key-Value, Document, Column, Graph) without requiring predefined schemas.
    • Availability: Focuses on high availability and eventual consistency (often guided by CAP theorem and BASE theory).
  10. Overview of Nginx core concepts and use cases

    Nginx is a high-performance HTTP and reverse proxy web server designed for high concurrency and low memory footprint. It is commonly used for:

    1. Static Resource Serving: Providing files directly from the local file system.
    2. Reverse Proxying: Acting as an intermediary to forward requests to internal servers, which enables hiding real server IPs, load balancing, and static/dynamic separation.
    3. Load Balancing: Distributing incoming traffic across a cluster of servers to prevent any single server from becoming a bottleneck. Supported strategies include:
      • Round Robin: Default strategy; requests are distributed sequentially.
      • Least Connections: Requests are sent to the server with the fewest active connections.
      • Fastest Response Time: Requests are sent to the server with the lowest response time.
      • IP Hash (Client IP Binding): Requests from the same IP are always routed to the same server, solving session sharing issues.
    4. Static/Dynamic Separation: Separating static content (served directly by Nginx) from dynamic content (proxied to a backend application), improving system robustness and access speed.
  11. Overview of Java Deque Interface

    The Deque (Double-Ended Queue) interface in the java.util package is a subtype of Queue. It supports element insertion and removal from both the head and the tail, allowing it to function as both a Stack (LIFO - Last-In-First-Out) and a Queue (FIFO - First-In-First-Out). Due to design flaws in the legacy Stack class (such as inefficient synchronization and exposure of Vector methods), the official recommendation is to use Deque instead of Stack.
  12. Overview of Spring Boot and its core philosophy

    Spring Boot is a lightweight open-source framework built on top of Spring 4.0. It is not a replacement for Spring, but a tool to improve the developer experience by simplifying the setup and development process. Its core philosophy is "Convention over Configuration," providing default settings that allow developers to build applications quickly with minimal manual configuration. It integrates numerous third-party libraries (e.g., Redis, MongoDB, JPA, RabbitMQ, Quartz) to provide an "out-of-the-box" experience.