Some of the common concepts in our development have been compiled into some classic explanations.

Source: Internet
Author: User
Tags object serialization

Interface instantiation
 
A general object, such as a specific class person, has been defined and needs to be instantiated. The syntax adopted is person objperson = new person ();

But the interface (such as iconnection) cannot do this, and it cannot directly new itself, such as iconnection objiconnection = new iconnection (),

This is the meaning of "the interface object cannot be generated as usual.

However, the object orientation is polymorphism and can be transformed upwards. For example, if a class implements this interface, and a class connection implements this interface, the connection class

An object can be instantiated to the iconnection interface. For example, iconnection objiconnection = new connection ()

Then, all programming operations are performed based on interfaces, which is separated from the implementation of specific classes and is more flexible and easy to expand in some cases.

Abstract The changed things into interfaces. Instead, letCodeIt is relatively fixed and can adapt to changes.

The interface cannot be real-listed, but it may be used to create an interface for the class through some classes

 

What is object serialization?

Let's start with why the object is serialized. Object serialization is required because sometimes data objects need to be transmitted over the network. During transmission, the objects need to be serialized and the serialized objects need to be taken out from the server storage media, then it is transmitted to the client through the network, and then the client reads the serialized object data into the memory, performs corresponding processing, saves the object data to the local storage medium, and then presents it as a file. This process is: Object> serialization> transmission> storage> deserialization (re-file format ). In my personal understanding, serialization is quite a kind of deep cloning, that is, converting your data objects into binary data for easy storage and transmission. Only after the objects are serialized can they be stored in the storage media; deserialization enables object data to be presented as files.

 

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.