Java SPI mechanism from principle to practice

1. What is SPI1. BackgroundIn the object-oriented design principle, it is generally recommended to program based on the interface between modules. Generally, the caller module will not perceive the internal implementation of the called module. Once the code involves specific implementation classes, it violates the opening and closing principle. ...

Posted by munchy on Thu, 25 Nov 2021 20:11:25 -0800

Java 23 design patterns -- visitor pattern (behavior design pattern)

Visitor mode brief introduction The purpose of visitor pattern is to encapsulate some operations imposed on some data structure element. Once these operations need to be modified, the data structure that accepts the operation can remain unchanged. Intent: mainly separate data structure from data operation. It mainly solves the problems of s ...

Posted by lulon83 on Thu, 25 Nov 2021 19:19:30 -0800

java Basics - input / output

1. File class    file class represents platform independent files and directories under java.io package, that is, if you want to operate files and directories in the program, you can use file class. It is worth noting that both files and directories are operated by file. File can create, delete and rename files and directories, and f ...

Posted by bob on Thu, 25 Nov 2021 18:32:20 -0800

Synchronization exercise (Java SE)

Case 1: Lambda expression exercise 1 Requirements: define an interface (Eatable), which defines an abstract method: void eat();         Define a test class (EatableDemo) and provide two methods in the test class                 One method is: use eatable (eatable E)     ...

Posted by ld0121 on Thu, 25 Nov 2021 18:18:21 -0800

Linux system programming - file IO

  man has nine volumes. System programming is the content of Volume II, and volume V is file format and specification open function Function prototype Parameter pathname file name Macro with parameter flags as access mode: o_ Rdonly (read only), O_ Wronly, O_ Rdwr (read write) these three must be added O_ Append, O_ Creat, O_ Excl ...

Posted by OriginalBoy on Thu, 25 Nov 2021 17:04:16 -0800

Interview - database mysql

concept Do you understand the database index? Generally speaking, the underlying data structure There are two common mysql structures: Hash index, B+ Tree index and full text index. We use innoDB engine, The default is B + tree. Differences between the two structures: The bottom layer of hash index is hash tab ...

Posted by Kerblam on Thu, 25 Nov 2021 12:30:13 -0800

With so many groups of wechat and QQ, how should we manage the friend relationship?

This article is excerpted from "design patterns should be learned this way"1. Application scenario of intermediary modeIn real life, the existence of intermediaries is indispensable. Without intermediaries, we can't communicate with distant friends. Each colleague object will reference each other. If each object interacts with multipl ...

Posted by dardsemail on Thu, 25 Nov 2021 12:24:19 -0800

java basic part

Here are some common interview questions, analysis of test sites, answers, etc. Basic concepts Some basic java knowledge, various basic concepts, etc. What are the access modifiers? difference? Modifier Current classSame packageSubclassOther packagespublic√√√√protected√√√×default√√××private√×××    Scan VX for Java data, front-end ...

Posted by Kingskin on Thu, 25 Nov 2021 11:11:47 -0800

Study notes: packaging

Learning content: packaging class (the examples are int type, and other types are painted according to gourd) Two new features have been added in Java 5, that is, automatic boxing and unpacking. Because basic types are widely used, but Java is an object-oriented language, it provides support for packaging types. There are eight wrapper cl ...

Posted by skyriders on Thu, 25 Nov 2021 10:15:13 -0800

Overview and Setup of AOP in Spring

How do we develop without using AOP? How do we develop without AOP (face-to-face thinking). In the first version of the development, we wrote the methods we needed, and in later maintenance updates, when we want to do the methods again, we need to add the functions to the written code. In the case of the first edition and subsequent additi ...

Posted by jandrox_ox on Thu, 25 Nov 2021 09:45:40 -0800