V. Interface-Oriented Programming
In my opinion, the most attractive feature of Object-Oriented Programming (OOP) for development technology improvement is the most influential interface. The interface defines a set of norms or standards, and how it is implemented depends on its implementation class, this provides developers with sufficient flexibility, greatly enhancing the system plasticity, and providing developers with more advanced and effective scalability. JDBC is one of the most typical examples of interface applications. Java JDK defines a set of interfaces, such as Connection, Statement, and ResultSet, but does not implement them. In fact, sun does not have the ability to implement it, because different DBMS have different data organization formats, and sun does not know how to connect to the database, how to execute SQL statements, and how to process returned result sets, therefore, the data access through interfaces is cleverly transferred to the database provider, so I have to say this is really brilliant.
In our system, the rational use of interface features can effectively improve the scalability and flexibility of the system, especially the emergence of Spring, through the strengthening of IOC, more prominent interface functions, it is easier for learners to understand the meaning of interfaces at the code level. The non-intrusive Design of Spring reduces the cost of component replacement and function expansion, opening another window for developers to develop programs.
Not all components in the system need to provide interfaces. When defining interfaces, you should first define the Function Extension points. For codes with fixed formats, you do not need to define interfaces. Generally, defining an interface for the business class is a good choice, and business changes are common. Providing interfaces for the business class helps us to actively adapt to business changes.
Eclipse makes "refactoring" more powerful. If your business class has no interfaces, you can use the "Refactor-> Extract Interface" menu to automatically generate corresponding business interfaces for the business class.