9.1 Abstract classes and abstract methods
Why do we have abstract classes?
is the desire to manipulate a series of classes through a common interface.
So what is the form of abstract classes?
Declaring the use of a class uses the abstract keyword and should have an abstract method in that class.
Note: Abstract methods are modified by the keyword abstract method.
The compiler prevents us from instantiating an abstract class.
9.2 interface
An interface is a further abstraction of an abstract class.
An interface declaration uses the interface keyword, and the fields in the interface are implicitly added keywords: static and final.
Interfaces want to be exported class implementations need to be done by keyword implement.
The methods in the interface are defined by default as public abstract.
9.3 Complete Decoupling
Complete decoupling using the policy mode, adapter mode, and proxy mode.
9.4 Multiple Inheritance
Interfaces and interfaces are functions that can be enhanced by multiple inheritance.
9.5 Extending the interface through inheritance
When using an inheritance extension interface, avoid defining the same names in different interfaces. This causes the compilation exception to occur.
9.6 Adapter Interface
The class is adapted to the interface through the adapter mode.
Domains in the 9.7 interface
The domain in the interface is static final by default.
9.8 Nested interfaces
When implementing an interface, you do not need to implement any interfaces nested inside it
9.9 Interfaces and factories
Creates an implementation object for an interface through Factory mode.
Provides a number of mechanisms for reuse.
Summarize:
In fact, is there a case of abuse in the interface (referring to the interface between the service and the DAO layer)?
At present, it is still not visible, perhaps their understanding of the framework is not deep enough?
But providing a template through an interface is a good way to implement it. is also a good programming idea.
In addition, the use of the intermediate interface in the project is relatively small.
Still need to accumulate more experience, want to think more!
Java programming thought Nineth Chapter interface