What are "long connections" and "short connections"?
The so-called short link refers to establishingSOCKETAfter the connection is sent, after receiving the data, disconnect immediately, the general bank uses the short connection explanation2long connections refer to theTCPcommunication, the connection is maintained regardless of whether the data is currently being sent or received. A short connection is a connection only when there is data transfer, customer-server communication/Close the connection when the data is transferred. Explain3The concept of long connections and short connections seems to move onlyCMPPThe agreement mentions that other places have not been seen. Communication means there are two kinds of connection between each network element: Long connection and short connection. The so-called long connection refers to aTCPmultiple packets can be sent continuously on the connection,TCPduring connection retention, if no packet is sent, both parties are required to send a detection package to maintain this connection. Short connection refers to the communication between the two parties have data interaction, the establishment of aTCPafter the data is sent, disconnect theTCPconnection, that is, each timeTCPconnection completes only one pair
CMPPthe sending of the message. At this stage, requestISMGmust be in a long-connected communication mode, it is recommendedSPwith theISMGa long-connected communication method is used. Explain4Short connections: for examplehttp, just connect, request, close, process time is short,The server shuts down the connection for a period of time without receiving a request.
The difference between HashMap and Hashtable
Hashtableand theHashMapThe class has three important differences. The first difference is mainly historical reasons. Hashtableis based on the oldDictionaryof the class,HashMapis aJava 1.2introduced byMapan implementation of the interface.
Perhaps the most important difference isHashtablethe method is synchronous, and theHashMapthe method is not. This means that while you can use a multithreaded application without any special action, you can use aHashtable, but you must likewise for aHashMapprovides external synchronization. One convenient way is to useCollectionsThe static of the classSynchronizedmap ()method, which creates a thread-safeMapobject and returns it as a encapsulated object. The method of this object allows you to synchronize access to potentialHashMap. The result of this is that when you don't need to sync, you can't cutHashtable(for example, in a single-threaded application), and synchronization adds a lot of processing overhead.
The 3rd difference is that onlyHashMapAllows you to set the null value as an entry for a table .Keyorvalue. HashMaponly one of the records can be an emptyKey, but any number of entries can be emptyvalue. This means that if a search key is not found in the table, or if a search key is found, but it is an empty value, thenget ()will returnNULL. If necessary, useContainkey ()method to differentiate between the two scenarios.
Some data suggest that when synchronization is required, use theHashtable, instead of usingHashMap. However, because when needed,HashMapcan be synchronized,HashMapthe function ratioHashtablefeatures more, and it's not based on a stale class, so some people think that in various cases,HashMapare preferred overHashtable.
AboutProperties
Sometimes, you might want to use aHashtableto mapKeythe string tovaluethe string. DOS,Windowsand theUnixThere are some examples of environment strings inKeythe stringPATHis mapped tovaluethe stringC:\WINDOWS; C:\WINDOWS\SYSTEM. hashtablesis an easy way to represent these, butJavaprovides a different approach.
Java.util.Propertiesclass isHashtablea subclass that is designed toString Keysand theValues. Propertiesobject uses the sameHashtable, but the class adds two ways to save time, as you should know.
Store ()method to put aPropertiesthe contents of the object are saved to a file in a readable form. Load ()method is exactly the opposite, used to read the file and setPropertiesobject to containKeysand theValues.
Note that becausePropertiesextends theHashtable, you can use super-classput ()method to add notStringobject thatKeysand theValues. This is not advisable. Also, if you willStore ()for one that does not containStringobject thatPropertiesobjects,Store ()will fail. As aput ()and theget ()the alternative that you should useSetProperty ()and theGetProperty (), they useStringparameters.
Well, I hope you can now know how to usehashtablesto speed up your handling.
What is half-work, full-duplex?
Full DuplexFull Duplex) refers to the ability to receive data while sending data,both are synchronized,It's like we usually call .,I can hear each other's voice while I'm talking..the current NIC generally supports full-duplex.Half Duplex (Half Duplex),The so-called half-duplex means that only one action occurs within a time period,To give a simple example,a narrow, narrow road,and there's only one car to go through.,when there are currently two-volume cars facing,In this case, there's only one first.,wait until the chief and the other one opens .,This example illustrates the principle of half-duplex in the image ..early walkie-talkie, as well as early hubs and other devices are based on half-duplex products.with the continuous improvement of technology,The semi-double unions gradually withdrew from the historical stage.
single-work communication means that the data on the communication line is transmitted in a single direction .
What is a workflow
WorkflowIs the computational model of the workflow, and the logic and rules for how work in the workflow are organized before and after it are represented in the computer with appropriate models and evaluated.
WorkflowIs the computational model of the workflow, and the logic and rules for how work in the workflow are organized before and after it are represented in the computer with appropriate models and evaluated.
The main problem for a workflow to solve is to automate the delivery of documents, information, or tasks between multiple participants, using a computer, and by a predetermined rule, to achieve a business goal.
The principle of workflow is a concept that is based on routine activities with fixed programs in the work, which can be executed and monitored through the definition of good tasks, roles, rules and processes to improve the level of production organization and work efficiency, and the workflow technology provides advanced means for enterprises to realize their business goals better.
Specific application:
Key business processes: order, quotation processing, procurement processing, contract review, Customer phone processing, supply chain management, etc.
Administrative categories: Travel applications, overtime applications, leave applications, application of the car, all kinds of office supplies applications, purchase applications, daily newspapers, such as the original manual transfer of the administrative form of processing.
Personnel Management Category: Staff training arrangements, performance appraisal, job change management, employee file information and so on.
Financial related categories: payment requests, receivables processing, daily reimbursement processing, travel reimbursement, budget and planning applications.
Customer Service Category: Customer information management, customer complaints, request processing, after-sales service management and other management.
Special Service classes:ISOseries of corresponding processes, quality management process, product data information management, trading company customs clearance, logistics companies, such as cargo tracking and other tasks through the form of manual flow through the completion of the task can be applied to automatically standardize the implementation of workflow software.
As a mature and stable workflow product, it not only provides daily office and intelligent management of key business processes, but also can easily and conveniently customize various processes at any time according to the special practical requirements of the company, and can realize the powerful functions of tracking, querying, statistic and printing of different roles.
Java Engineer Unicom XX interview Topic