Java memo knowledge point

Source: Internet
Author: User
1. Notes When importing eclipse Projects

1) the same location can only be used once, and the project cannot have the same name.

2). New Java project-Create project from existing source

 

2. When your interface is very slow, when reading data is very slow... when you want your Program Use cache for quick presentation. As follows:

Declare cache variables:

Private Static objectcache _ cache = memorycache. default;

Public static objectcache Cache

{

Get {return _ cache ;}

}

Save the variable to the cache:

Cacheitempolicy policy = new cacheitempolicy ();

Policy. absoluteexpiration = datetimeoffset. Now. addhours (time );

_ Cache. Add (save name, object to be saved, policy );

Slave cache value:

Object Type save = cache [Save name] as object type;

 

3. What the interviewer often asks

Rewriting (refactoring and overwriting) is intuitive. Subclass covers the methods for returning values of the same name and parameter of the parent class (three identical ).
Overload, with the same name.

4. Efficiency

List and hashmap are more efficient
List is compared one by one,
Hashmap calculates the hashcode first, locates it, And then compares it.

Arraylist is a dynamic array, which does not include quick access through key or value.AlgorithmTherefore, calling indexof, contains, and other methods is actually a simple loop of execution to find elements. Therefore, frequent calls to such methods are not faster than writing loops by yourself and are slightly optimized, we recommend that you use a set of key-value pairs, such as hashtable or sortedlist, to meet this requirement.

5. Ria

Traditional network programs are developed based on pages and server-side data transmission modes. The presentation layer of network programs is built on HTML pages, while HTML is suitable for text, the traditional page-based system has gradually become unable to meet the higher and all-round experience requirements of network viewers. This is what Macromedia calls "Experience matters "), the emergence of rich Internet applications (RIA) is to solve this problem. Ria is a new generation network application that integrates the best user interface functions of desktop applications with the universal adoption of Web applications, fast and low-cost deployment, and real-time interactive multimedia communication. At present, the Web field and the desktop software field are gradually moving closer to Ria. It is expected that the era of RIA will come three or five years later.

What is compatible with RIA is the increasingly powerful cloud computing. Ria is a rich client that stores all major computing tasks locally and uses only the network to transmit a small amount of key data. Cloud computing, on the contrary, puts all kinds of data processing on the server side, thus reducing the pressure on the client side.

6.3-tier

The three-tier architecture (3-tier Application) generally divides the entire business application into: presentation layer (UI) and business logic layer (BLL) data access layer (DAL ). The purpose of hierarchy differentiation is the idea of "high cohesion and low coupling. 1. Presentation layer (UI): The interface displayed to the user, that is, what the user sees when using a system. 2. Business logic layer (BLL): operations for specific problems can also be said to be operations on the data layer and data business logic processing. 3. Data access layer (DAL): transactions made at this layer directly operate on the database and add, delete, modify, and query data.

MVC (Model-View-Controller) is a design pattern that we can use to create a distinction between a domain object and a UI presentation object. They also have an architecture level. The same thing is that they all have a performance layer, but they are different from the other two layers. The concept of controler is not defined in a three-tier architecture. This is what I think is the most different. MVC does not regard the logical access of the business as two layers, which is the main difference between building a program using a three-layer architecture or MVC. Of course. Model is also mentioned in Layer 3, but the concept of Model in Layer 3 architecture is different from that in MVC. The typical model layer in Layer 3 architecture is composed of entity classes, in MVC, it is composed of business logic and access data.

7. "Everything is socket !"

Although a little exaggerated, the fact is that almost all network programming is now using sockets.
Socket originated from UNIX, and one of the basic philosophies of Unix/Linux is "Everything is a file". You can use the "Open-> read/write-> close" mode to operate. My understanding is that socket is an implementation of this mode, and socket is a special file. Some socket functions are operations (read/write Io, open, and close) on it)

 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.