Visitor mode of behavior mode

1 General Visitor pattern is a behavior pattern, which is not commonly used. It can separate the algorithmic logic acting on the object from the object itself. 2 visitor mode When we need to operate on a group of similar types of objects, we can maintain the operation logic within each object separately, but this violates the principle of singl ...

Posted by markl999 on Sun, 31 May 2020 11:54:48 +0200

Talk programming - responsibility chain mode

Chain of Responsibility Pattern It gives multiple objects the opportunity to process the request, thus avoiding the coupling between the sender and the receiver of the request. Connect these objects into a chain, and pass the request along the chain until there is an object to handle it. motivation Each processing object determines which com ...

Posted by KCAstroTech on Sun, 31 May 2020 09:37:16 +0200

C#Simple Getting Started - Suitable for Beginners

First C#Program using System; namespace HelloWorldApplication // Namespace Declarations { /* Class name is HelloWorld */ class HelloWorld // A class { /* main function */ static void Main(string[] args) { /* My First C#Program */ Console.WriteLine("Hello World!"); Co ...

Posted by roneill on Sat, 30 May 2020 18:44:39 +0200

This problem Maven relies on, you dare say you haven't met

If Maven's dependency is not handled properly, it often leads to some problems, which is very annoying. Today I'd like to share with you a dependency related problem that you may have encountered before. Problem background There is an ES search project, which is still in good condition at the beginning. After a while, it is found that the start ...

Posted by foxy69 on Sat, 30 May 2020 11:57:00 +0200

JDK14 performance management tool: introduction to jstack

brief introduction In the previous article, we introduced the use of jstat tool in JDK14. In this article, we will further explore the use of jstack tool. jstack tool is mainly used to print java stack information, mainly java class name, method name, bytecode index, row number and other information. More highlights: Blockchain from getting st ...

Posted by unidox on Sat, 30 May 2020 03:56:47 +0200

Istio police agent & envoy start process

Opening Through the previous article Istio Sidecar injection principle It can be found that the Sidecar application has been injected at the same time when the application is submitted to the kubernate deployment. If you are careful, you can also find that in addition to the application of istio proxy, there is also an Init Containers of istio ...

Posted by virtual_odin on Wed, 27 May 2020 13:02:34 +0200

How do I use Lock? What is the difference between Lock and synchronized?

  Lock   It's like a synchronization block, java.util.concurrent.locks.Lock Is the thread synchronization mechanism. However, locks are more flexible and complex than synchronous blocks. Because lock is an interface, you need to use one of its implementations to use lock in your application. ReentrantLock is one such implementation of ...

Posted by greedyisg00d on Wed, 27 May 2020 07:09:42 +0200

Implementing counters in Java multithreads using the JDK built-in tool class

Preface In the actual development process, we often encounter businesses that require multi-threaded concurrency. Finally, we need to summarize the tasks completed by each thread, but the main thread usually ends earlier than the sub-threads. If you want to wait for each sub-thread to finish before running the main thread, you need to identify ...

Posted by freedomclan on Mon, 25 May 2020 18:56:38 +0200

[LeetCode] 9 Word Split 2

subject 140. Word Split II Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces to the string to construct a sentence so that all words in the sentence are in the dictionary.Return all these possible sentences. Explain: Words in the dictionary can be reused when separating. You can assume that t ...

Posted by hellangel on Mon, 25 May 2020 18:45:06 +0200

Here comes the redis dry goods you want! Redis cluster model construction and principle explanation

Source network, only for learning, if there is infringement, please contact delete. Before Redis 3.0, sentinel mechanism was used to monitor the status of each node. Redis Cluster is redis's distributed solution, which was officially launched in version 3.0, effectively solving redis's distributed requirements. When encountering single machin ...

Posted by nigelbashford on Mon, 25 May 2020 10:23:23 +0200