From: http://danielzzu.blog.163.com/blog/static/11851530420112311303240/
I. What is a simple framework: a framework is a semi-finished software that can complete certain functions. In essence, a framework is a software and a semi-finished software. The so-called semi-finished products cannot fully implement the functions required by users. The framework is only part of the functions required by users. Further Processing is required to become a complete software that meets users' needs. Therefore, the main customers of framework-level software are developers rather than end users. Some may think that since the Framework is only a half-finished product, why study and use the framework? The learning cost is not small, that is, because the framework can complete certain functions, that is, this "certain functions already completed by the Framework" is attracting developers, let everyone learn and use the framework. Ii. What architecture can the Framework do to complete certain functions and speed up application development? Because the framework has completed certain functions, and usually some basic, difficult, and general functions, this prevents us from starting from the ground up during application development, but continuing to develop based on the existing functions of the framework. That is to say, the functions of the framework will be reused to speed up application development. The architecture gives us a sophisticated program architecture framework that defines the overall structure of the application, including the division of classes and objects, the main responsibilities of each part, the collaboration between classes and objects, and the control process. Currently, most of the popular frameworks in the Java field are developed by masters and well-designed. Development Based on such a framework generally follows the structure planned by the framework, so that the structure of the developed application is relatively better. 3. The understanding of the framework is developed based on the framework. The things are still those things, but the relationship between the application and the framework depends on who is doing the problem. You can use a diagram to briefly describe it, as shown in figure 1:
Figure 1 if there is no framework in the simple relationship between the application and the framework, all the features required by the customer will be developed by the developers themselves. No problem, the features required by the user can also be implemented, it's just a lot of work for developers. If the framework has completed some functions, the existing functions of the framework can be disabled by developers. Developers only need to complete the functions not provided by the framework, the last step is to complete all the features required by the customer, but the work of developers is reduced. That is to say, for framework-based development, the functions to be completed by the software have not changed, or all the functions required by the customer, that is, the meaning of "things or things. However, with the framework, the framework has completed some functions, and then the developers have completed some of the functions. Finally, the framework and the developers have completed the functions of the entire software, that is, the question of who is responsible for these features. Based on framework development, you can not do what the framework does, but you should understand what the framework is doing and how the framework implements the corresponding functions. In actual development, the relationship between applications and frameworks is generally not as clearly divided as described above. More commonly, they interact with each other, that is, applications do part of their work, then the framework does a part of the work, then the application does a part of the work, and then the framework does a part of the work, so staggered, and finally the application and framework combine to complete the user's functional requirements. It is also illustrated in a diagram, as shown in Figure 2:
Figure 2 Relationship between an application and a framework if a rectangle consisting of an application and a framework is combined as the final software. If you don't understand what the framework is doing, it's equivalent that the framework is a black box for you, that is, what will happen if you remove the two blocks of the Framework in Figure 2 above? Yes, the rest of the applications are fragmented and separated from each other. This will lead to a very fatal problem. It is unclear how the entire application runs. That is to say, the project is out of control for you. From the perspective of project management, this is very dangerous. Therefore, during framework-based development, although we can not do what the framework does, we should understand what the framework is doing. If conditions permit, we should also clarify how the framework implements the corresponding functions. At least we should clarify the general implementation ideas and implementation steps so that we can take overall control of the entire project, to minimize project loss. Iv. Relationship between the framework and the design model is more abstract than the framework. The framework is already implemented. Although it is only a semi-finished software, it has been implemented after all. The focus of the design model lies in the solution to the problem, that is, it is still at the ideological level. Therefore, the design pattern is more abstract than the framework. The design model is an architecture element that is smaller than the framework. As described above, the framework is a software that has been implemented and implements a series of functions. Therefore, a framework, it usually contains applications with multiple design patterns. The framework is more special than the design model. The framework is a semi-finished software that completes certain functions. That is to say, the purpose of the framework is very clear. It is a very specific function to solve some problems in a certain field, the frameworks implemented in different fields are different. The design model remains at the ideological level and can be applied in different fields, as long as the corresponding problems are suitable for a specific design model to solve. Therefore, the framework is always targeted at specific fields, and the design model focuses more on solving problems from the ideological perspective and methods, making it more universal.