Design pattern principle

Six principles 1. Opening and closing principle: open to expansion and close to modification. When the program is expanded, it is realized by adding code without modifying the original code. For example, if you want to write an addition calculator, you can define a class to input two numbers and symbols, but if you want to add n ...

Added by Lol5916 on Thu, 28 Nov 2019 22:51:25 +0200

JDK source reading: Enum class

Article directory Enumeration type Define an enumeration type Compile Decompile summary Enumeration type Define an enumeration type public enum Calculator { ADD,SUBSTRACT,MUTIPLE,DIVIDE; } Enum is very similar to a special class. In fact, the type defined by enum declaration is a class These classes are al ...

Added by fitzromeo on Wed, 27 Nov 2019 22:21:00 +0200

Summary analysis of queue and stack of data structure

1. Preface: Queues and stacks are also two common data structures in the data structure. Queues and stacks are also complementary in the actual use scenarios. Here is a brief summary, if there are any differences, point more, thank you. 2. Introduction to Queues Queues, as its name implies, means queuing. According to our real life, queuing ...

Added by minou on Sat, 16 Nov 2019 19:57:53 +0200

Learn Java and implement simple calculator (with brackets)

I. implementation principle Get the calculation expression: when the user clicks the button, the value of the display will push. But push requires: if it is a bracket or an operator, then it should be followed by + a space string, and then push Create a set to store operators (stack 1) as symbols, and a set to store new expressions (stack 2) ...

Added by johnh2009 on Wed, 30 Oct 2019 04:09:13 +0200

Spring custom enhancement method

Custom enhancement methods, also known as notification methods, are Java methods annotated with @ Before, @ AfterRunning, @ AfterThrowing, @ After or @ Around annotations.   @Before Pre enhancement (also known as pre notification): in the target methodimplementPrevious implementation @After ...

Added by davidmuir on Wed, 23 Oct 2019 21:41:17 +0300

[original] Linux memory management - zoned page frame allocator - 3

background Read the fueling source code! - by Lu Xun A picture is worth a thousand words. --By Golgi Explain: Kernel version: 4.14 ARM64 processor, Contex-A53, dual core Using tool: Source Insight 3.5, Visio 1. overview This article will analyze watermark. Simply put, when using the zoned page frame allocator to allocate pages, the availa ...

Added by FSGr33n on Sun, 20 Oct 2019 12:46:52 +0300

JAVA Basic Knowledge | Generics

First, what is generics? Generics are "parameterized types". For example, by defining a variable A, we can define this variable as a string type or an integer in the following way. String A; Integer A; Of course, when the type of variable is known, if there is one case, we do not know what type we will need when defining the vari ...

Added by catalin.1975 on Mon, 23 Sep 2019 17:49:43 +0300

Design Mode Simple Factory Mode (Talk about Westward Journey Learning Notes)

1. Object-Oriented Programming Benefits Object-oriented programming reduces program coupling by encapsulation, inheritance, and polymorphism. Encapsulation: hides implementation details and attributes, controls access to attributes through a pu ...

Added by kmutz22 on Sat, 07 Sep 2019 05:13:52 +0300

Do you know the common JavaScript design patterns?

Original: https://medium.com/better-programming... Translator: Front-end Technology Brother brief introduction We write code to solve problems. These problems usually have many similarities. When we try to solve these problems, we will notice several common patterns. This is where design patterns come into play. The term design pattern is use ...

Added by Skoalbasher on Sat, 10 Aug 2019 17:14:13 +0300

Android Calculator - Introduction

Android Calculator - Introduction Author: Knight in Black I. Preface This is the first App I wrote, using the third chapter of Android First Line Code, some knowledge of UI controls. Then the overall structure synthesizes some works on CSDN blogs and short books. Similarly, in writing Android calcu ...

Added by deckrdx on Mon, 29 Jul 2019 16:49:20 +0300