Java – things to consider when building a framework

We are planning to build a framework: a cost estimation framework that will be used in all areas of our organization

The high-level requirements are as follows: if I develop a product, how much will it cost? The cost incurred will be used to compare with the cost quoted by the supplier and make a decision on which supplier to choose

Now my question is: what should I consider when developing a framework?

I have few ideas:

>Implement advanced requirements through abstract classes and interfaces > provide utility classes that may be useful to framework users. > Consider that it should be internal metadata - it should not be displayed to framework users. > Design patterns use image templates. > Enter the properties and methods of the class

Solution

Several ideas:

>It's easier to add useful features later than to remove features that prove to be poorly designed or harmful. > Design of inheritance or prohibit it: inheritance introduces an additional level of complexity because you need to solve the interaction between superclasses and subclasses This is not to say that it is evil, but it should be considered very carefully. > In my experience, interfaces are usually clearer than abstract classes because they promote composite inheritance. > For interfaces, record what the caller should expect and what the implementer should expect Basically think of the contract between both parties and record it In particular, the document invalid constraint - does the method accept null? Should they promise never to return null? > Design testability, your framework and others using your framework Which bits of the framework can reasonably be used to test code and which should be ridiculed? > Use your own framework from the beginning Build a sample application that others can use to understand the framework

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>