Netty source code simple analysis 1
I briefly read the source code of netty5 over the weekend. I only understood the rough idea and recorded the results so that I can recall it next time.
Server code:
public void run() throws Exception {
Filter reflects the responsibility chain mode
1. Preface
The Filter-Filter technology is a newly added function of servlet2.3. Complete process: pre-process user requests, send the requests to the Servlet for processing and generate a response, and
Design Pattern Visitor Design Mode
The visitor design pattern is that there is already a set of Person objects, and then different visitors access this set of objects, it will have different effects.
These visitors are actually actions that can be
Sort (select, Hill, binary insert)Select sorting method 1st, in the record to be sorted r [1] ~ Select the smallest record from r [n] and exchange it with r [1]. For example, 2nd rows, in the record to be sorted, r [2] ~ Select the smallest record
Sort (select, Hill, binary insert), and Hill binary insert
Select sorting method
1st times, pending sorting records r [1] ~ Select the smallest record from r [n] and exchange it with r [1]. For example, 2nd rows, in the record to be sorted, r [2] ~
Analysis, structure diagram, and Basic Code of the Bridge ModeZookeeper
We discussed the visitor mode yesterday. Today we will talk about the Bridge Mode:
Definition: separates abstract parts from their implementations, so that they can change
Java web SQLHelper class EncapsulationIn this project, I was most satisfied with myself by encapsulating the SQLHelper class. I am very proud of myself. I am a beginner. I didn't know how to do this at the beginning, I just tried to do this, and the
Java web SQLHelper class encapsulation, javasqlhelper
In this project, I am most satisfied with myself by encapsulating the SQLHelper class. I am proud of myself mainly because
I am a beginner. I didn't know how to do this at the beginning. I just
NSString filters blank and empty lines at the beginning and end, and converts multiple line breaks into single line breaks.
-(NSString *) filterBlankAndBlankLines :( NSString *) str
{
NSMutableString * Mstr = [NSMutableStringstring];
NSArray * arr =
Control inversion and dependency injection in Java1. Introduce dependency injection and control reversal. The purpose is to decouple classes and improve the scalability and maintainability of the system. Here is an example to introduce this concept.
Input two numbers on the keyboard and output them in small and large order.# Include
# Include
Int main ()
{
Int num1, num2;
Int * num1_p = & num1, * num2_p = & num2, * pointer;
Printf ("Input the first number
[Guava Study Notes] Collections: collection tool class, guavacollections
My technical blog is often maliciously crawled and reproduced by rogue websites. Please move to the original article: Workshop.Static factory method for Tool Set
List
Java keywords synchronized
The synchronized keyword indicates that this method is locked. It is equivalent to checking whether thread A is using thread B (or C D) every time it runs to this method ), if yes, wait until thread B (or C D) that is
The path to code cleanliness
The Map ing code of the Sensor class object is as follows:
Map sensors = new HashMap ();
When other parts of the code access these sensors, the following code appears:
Sensors s = (Sensors) sensors. get (sensorId );
Polymorphism-instance, polymorphism instance
/** * Created by rabbit on 2014-07-10. */ abstract class student { public abstract void study(); public abstract void sleep();
}Class Basestudent
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service