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