Ilist and list

Source: Internet
Author: User
FAQs:

Ilist <> itself is only a generic interface. Since it cannot be instantiated, you can only use the following method:
Ilist <class1> ilist11 = new list <class1> ();
But why not use List directly:
List <class1> list11 = new list <class1> ();

What are the advantages of the first method.

Summary:

Ilist <> is supported in. net2.0.

Benefits .. for example, humans and tiger both have the walking function. You can classify them into interfaces. When one of your animal classes includes the two animals, if you want them to walk, you only need to call the same method. No matter what type of person you want to walk, a person has two feet but four limbs, animals have four legs, which is achieved by specific animals. However, when they are walking, they are all 4-legged and all of them are moving forward by a certain distance (of course, moving forward ), therefore, I think these can be categorized as abstract behaviors. How far can a specific step be taken depends on the height/length of each specific implementation.

Use ilist <class1> ilist11 = new list <class1> ();
To facilitate later modification, when you do not use list to use other types
You only need to modify this location.
No need to modify too many places

 

Ilist <> is an interface that defines some operation methods. You need to implement these methods by yourself.

List <> is the methods defined by the ilist type.

List <class1> list11 = new list <class1> ();
To create a list <class1> and use the list <t> function, perform related operations.
While
Ilist <class1> ilist11 = new list <class1> ();
You only want to create an instance of Objects Based on the Interface ilist <class1>, but this interface is implemented by list <t>. Therefore, you only want to use the functions specified by the ilist <t> interface.

Loose coupling of interfaces... facilitates system maintenance and reconstruction... optimizes system processes...

Encouraged Interfaces
This separates functions from specific implementations.
Principle of implementing interface Separation
Not actually needed

FAQs:

Ilist <> itself is only a generic interface. Since it cannot be instantiated, you can only use the following method:
Ilist <class1> ilist11 = new list <class1> ();
But why not use List directly:
List <class1> list11 = new list <class1> ();

What are the advantages of the first method.

Summary:

Ilist <> is supported in. net2.0.

Benefits .. for example, humans and tiger both have the walking function. You can classify them into interfaces. When one of your animal classes includes the two animals, if you want them to walk, you only need to call the same method. No matter what type of person you want to walk, a person has two feet but four limbs, animals have four legs, which is achieved by specific animals. However, when they are walking, they are all 4-legged and all of them are moving forward by a certain distance (of course, moving forward ), therefore, I think these can be categorized as abstract behaviors. How far can a specific step be taken depends on the height/length of each specific implementation.

Use ilist <class1> ilist11 = new list <class1> ();
To facilitate later modification, when you do not use list to use other types
You only need to modify this location.
No need to modify too many places

 

Ilist <> is an interface that defines some operation methods. You need to implement these methods by yourself.

List <> is the methods defined by the ilist type.

List <class1> list11 = new list <class1> ();
To create a list <class1> and use the list <t> function, perform related operations.
While
Ilist <class1> ilist11 = new list <class1> ();
You only want to create an instance of Objects Based on the Interface ilist <class1>, but this interface is implemented by list <t>. Therefore, you only want to use the functions specified by the ilist <t> interface.

Loose coupling of interfaces... facilitates system maintenance and reconstruction... optimizes system processes...

Encouraged Interfaces
This separates functions from specific implementations.
Principle of implementing interface Separation
Not actually needed

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.