Factory method pattern of Java design pattern

1, Overview Factory is the place where products are produced. Using the concept of factory in Java design pattern is the place to generate objects. Why add a factory class to an object that can be created directly? This requires us to understand what problem the factory method is to solve. If there is only one class, we can directly new an ...

Added by jwilley on Sat, 12 Feb 2022 06:20:47 +0200

Simple discussion on decoration mode

Simple discussion on decoration mode 1. Brief description of decoration mode Decoration pattern is a design pattern used to replace inheritance. It dynamically adds responsibilities to objects without defining subclasses, and uses the association relationship between objects to replace the inheritance relationship between classes. It reduc ...

Added by seanpaulcail on Fri, 11 Feb 2022 13:32:53 +0200

Analyze the way out of Android development in the future, Android interview questions and analysis

preface As the saying goes, "born of hardship, die of happiness", in fact, most middle-aged crises are produced in happiness. Some people may retort, "as you say, I still have to struggle. If I don't struggle, I will die. Isn't it wrong to choose a comfortable life? Don't I have the right to choose my own way of life?" Pe ...

Added by Nytemare on Fri, 11 Feb 2022 08:12:46 +0200

Spring code tips that you can't put down

I happen to have some research on spring source code. Combined with my practical work experience in recent years, I summarize the knowledge points I think are good in spring. I hope it will be helpful to you. Seek attention Welcome to pay attention to my B station accountStation B account number If the content can help you, you are welcome to ...

Added by RockRunner on Fri, 11 Feb 2022 02:24:16 +0200

Design mode [13] - how to get the template mode?

The beginning is still the same kind of picture. Please look downZhang Wuji learned Taijiquan, forgot all the moves and knocked down the "two old men in the dark", the so-called "no moves in the heart". If you can learn all kinds of patterns at will, it can be said that you can forget all kinds of patterns at will.What is th ...

Added by almightyegg on Thu, 10 Feb 2022 08:06:11 +0200

State mode of javascript Design Pattern

concept State mode: allows an object to change its behavior when its internal state changes. The object seems to modify its class. Start with the electric light Requirements: An electric lamp that realizes a switching function Code implementation: class Light { constructor() { this.state = 'off' // Default light off ...

Added by nowaydown1 on Thu, 10 Feb 2022 03:28:50 +0200

Java view code generated by dynamic proxy

https://www.cnblogs.com/ctgulong/p/5011614.html 1. Create an agent that exports the generated class Agent is used to deal with a jvm. It needs to implement a static public static void premain(String agentArgs, Instrumentation inst) method I use the following code to create an agent package ctgu.jagent; import java.io.File; import java.io.Fi ...

Added by frog_ on Wed, 09 Feb 2022 20:14:11 +0200

During the interview, I was asked what to do with the HashMap of fluent / dart?

preface I believe many students were asked about HashMap during the interview, especially Java/Android programmers. HashMap is almost bound to be mentioned. Because there are too many points to dig. HashMap about Java can be seen everywhere on the Internet. Naturally, with the popularity of fluent, you may also be asked about the HashMap of fl ...

Added by xyzleft on Wed, 09 Feb 2022 19:02:03 +0200

Singleton pattern of design patterns you can understand

preface *** The author writes a blog mainly to summarize the technology and deepen his understanding of it. If there are any mistakes, please help point out them. Singleton mode 1. Definitions Definition of Singleton pattern: a pattern in which a class has only one instance and the class can create the instance itself. 2. Features ...

Added by PurpleMonkey on Wed, 09 Feb 2022 16:11:36 +0200

Detailed explanation of Java singleton mode

Brief description A class has only one instance. It is created by itself and provides an entry for obtaining an instance. External classes can directly obtain the instance object through this entry. Scene In many cases, the whole application can only provide a global object. In order to ensure uniqueness, the reference of this global ...

Added by dta on Wed, 09 Feb 2022 13:57:55 +0200