Design pattern – 07.AbstractFactory abstract factory

Article directory Abstract FactoryAbstract Factory Motivation Schema definition Structure Summary of key points Abstract FactoryAbstract Factory The factory method can be regarded as a special case of abstract factory, also called factory method. Motivation In software systems, we are often faced with the creation of “A series of interdependent objects“; at the same time, due […]

Socket abstraction layer and sticky packets

Table of Contents 1. Socket abstraction layer 2. Socket programming based on TCP protocol 2.1 Server socket function 2.2 Client socket functions 2.3 Public-purpose socket functions 2.4 Lock-oriented socket approach 2.5 File-oriented socket functions Socket programming based on TCP protocol (simple) Server client 3. Socket programming + communication + communication cycle Server client 4. Socket […]

Abstract and easy java – mybaties

Pre-workhttp://t.csdnimg.cn/RVvn4 IDEA after completing the pre-production work should look like this Official introduction to mybaties The first step is to open the official website document of mybatieshttps://mybatis.net.cn/getting-started.html In this entry, we will construct a SQL factory from XML The first step is to create an XML file with a random name New → File → […]

Misunderstandings about abstract keyword

The reason is that I hand-written a JUnit4 test class: import org.junit.*; import static org.junit.Assert.*; public class MyTest { @Test public void testAbc() { assertEquals(1, 1); } } Then run and report an error java -cp lib/junit-4.13.2.jar;.junit.textui.TestRunner MyTest .F Time: 0.005 There was 1 failure: 1) warning(junit.framework.TestSuite$1)junit.framework.AssertionFailedError: No tests found in MyTest Modify so that […]

Abstract and easy java – simple shopping cart system

public class GoodsShop { public static void main(String[] args) { System.out.println(“Welcome to the shopping cart management system”); obj [] arr = new obj[50];//obj[50] is the upper limit of the shopping cart quantity obj obj = new obj();//Call obj Scanner scanner = new Scanner(System.in);//Input while (true) { System.out.println(“Enter 1 to enter the add page”); System.out.println(“Enter 2 […]

Abstraction layer design method in embedded software architecture

Hello everyone, today I would like to share an article related to embedded software architecture design. There are different opinions and opinions on software architecture. What is software architecture? We can find countless definitions on the Internet. For example, we can define it this way: Software architecture is the basic structure of a software system, […]