This article from http://www.cnblogs.com/goodcandle/archive/2005/11/07/ownapi.html
In my Article Home Finance Manager--Software Design There are two classes : Cmodelbase And Cffmmodel , Cffmmodel Yes Cmodelbase . At the time of design, I thought it was quite good. The two should have some connection. From the perspective of name, I can see it at first glance. Cmodelbase Yes Cffmmodel The name of the parent class. But is this really good?
There is a saying: "An interface belongs to its customers, rather than its derivation ." When I read this passage, I felt quite touched. The logical binding relationship between a customer and an interface is stronger than that between an interface and its derivation. We often say that "customers are God. In fact, when designing the software, we must take it into consideration. If your interface is easy to misunderstand or the interface is too complex, then the user (that is, the so-called customer) I am not willing to use it. Although the customer may not be clear here, because the caller may be your colleague, but if you call your interface, it is the customer, you have to take responsibility for him.
Here is an example:
Here, if the interface class is namedClightinterfaceThe customer thinks this class can only processClightBut in factClightinterfaceCan process all objects with switch operations.
So I'm writing a Home Finance ManagerCodeYou don't have to hesitateCmodelbaseChangeCviewoperate, Possibly in myProgramBut the habit needs to be developed slowly.
The keep in mind interface belongs to the customer.