1.1.2 application framework features

Source: Internet
Author: User

1.1.2 features of the application framework

Compared with otherProgramThe architecture has five main features: modularization, reusability, scalability, simplicity, and maintainability.2Although these features are not fully specific to the application framework, they maintain a balance between these features, it is the best option to write large and medium-sized Application Software Systems with complex structures and variable requirements.

Modular

The application framework can be logically divided into multiple logically independent layers or modules. Modularity is not a unique feature of the application framework. Many applications have this feature. Its advantage is that the entire application is independent of multiple associated modules, which improves application aggregation, this reduces application coupling. Each Independent module communicates with each other through a unified channel or protocol. In this way, when a major internal change occurs in a module, as long as its communication Entry and Exit remain unchanged, it does not affect the effectiveness and reliability of other modules in the system.

In terms of development efficiency, modularity is a good way to achieve "people do their best. Divide applications into different modules, and personnel with different capabilities and technologies can perform the tasks at the same time. For exampleB/SStructure Application, allows the artist to take charge of the interface side (UILayer) design, familiarASP. NET,JSPProgrammers are responsible for Application Layer Development and are familiar with Server programming.Web ServiceDatabase Design personnel are responsible for databases. In this way, the development efficiency is much more efficient than that of programmers from scratch.

Reusability

CodeReusability is an important indicator of code quality. Whether using functions, classes, or other higher-level Reuse models, they are designed to improve reusability to some extent and prevent programmers from writing repeated code. In the application framework, not only functions and classes can be reused, but also a set of logic and design modes composed of multiple classes. We can simply think that one of the main purposes of the design framework is to achieve code reuse.

Reusability is not an easy task. On the contrary, designing a system with good reusability is not only difficult but also requires continuous iterative design. In object-oriented language, when a type is referenced by other objects, it is easy to produce the logic errors of other objects exponentially when a logic error of this type is fixed, this so-called "feature interaction" is one of the fatal logic errors in design and the biggest enemy of reusability.

The simplest type of code reuse is to use the function library (Library), High-quality related functions can be combined into a distributable library, but these functions are not necessarily closely related. Users must find the appropriate functions from the function library, its usage efficiency depends on the user's familiarity with the function library and the degree of perfection of the document.

The class library is more complex than the function library. The Class Library provides (Class) Instead of a single function, a class usually contains functions with some associations, making these functions easier to differentiate. In addition, class libraries usually use abstract classes for hierarchical design, in this way, function functions of the class can be used more easily.

Design Mode (Design Model) Is another more advanced reuse, which describes how to efficiently create various parts of the object-oriented system and how to use specific policies to solve specific problems under certain circumstances, this reuse involves object-oriented methodology.

Framework reuse is a collection of reuse modes of class libraries, design patterns, and work patterns (and sometimes function libraries). It is not only used for specific functions and abstract strategies for solving problems, it also includes the specific process and rules for solving the problem. In terms of the degree of reuse, the application framework is the most advanced reuse mode.

The difference between the application framework and the function library is that the latter only provides multiple sets of discrete functions with no or few internal logical relationships. The call sequence and call relationship of these functions are not clear, it's like usingWin32 APIDevelopmentWindowsSimilar to programs, a simple form design requires hundreds of lines of code, and users must keep in mindAPIThe order of use.MFCWhen the framework writes a form, the number of code is much smaller, and the programmer needs to consider less internal details, becauseMFCA large number of unnecessary details have been hidden behind the framework. Developers do not have to worry about common and cumbersome implementations. In addition,Visual c ++It also provides developers with a variety of working modes, that is, the development of general templates, wizard and methods for different types of programs, all of which are the biggest difference between the application framework and general function libraries.

There is no direct relationship between modularization and reusability. Not all modular software has good reusability performance, and reusable components are not necessarily modularized. In general, modular implementation of the divide and conquer strategy, reusability is the reuse of functions in different places3.

Scalability

Scalability is one of the most significant features of the application framework. It means that the functions of the application framework can grow. Application Frameworks without scalability have no value or significance in use, because they are designed to provide a Unified Context Environment for specific applications. The scalability of the application framework enables us to implement different functions based on a platform to meet different applications. Of course, many applications require the support of the platform itself.

The Framework's scalability is mainly achieved through inheritance and aggregation. Inheritance means that the base class is inherited from a derived class, and the function is extended by reusing the functions of the base class and defining new functions; the aggregation method refers to calling different types to combine them into a new type and extending new functions. The two methods do not necessarily have the best mode between them. Developers should use them in the right place, but in general, we recommend that you prefer aggregation instead of inheritance to extend the function.

ToMFCAs an example, the main method to expand a framework is to develop a new class with different basic classes to achieve the purpose of expansion. In the plug-in framework, plug-in types are extended by implementing interfaces released by the framework.

Simplicity

The simplicity of the framework cannot be measured by the difficulty of developing framework extension components. In fact, no framework can ensure that the logic design and code workload of programs developed based on itself are more advantageous than those without framework development. The simplicity of the Framework is embodied in the framework that provides a clear working mode, that is, the general implementation steps for developing certain types of extension plug-ins, the internal association and management of framework plug-ins are controlled by the framework itself, without the consideration of framework users. Users may not be familiar with the internal collaboration structure of the Framework, however, the development of extension plug-ins can be easily upgraded and refined on the basis of the unified steps.

The simplicity of the framework is also reflected in the fact that it generally has an "auxiliary class library" with internal logical associations and rich functions. developers can make full use of the existing auxiliary functions and code of the framework. For example. NET Framework, Such as security, encryption, data flow and other general functions can be directly obtained from the framework class without the programmer's own development and implementation.

Maintainability

Maintainability is the capability that applications can easily change after business needs change. To enable the Framework to be shared and used by different applications, it can be composed of general components that are completely unrelated to the business, and the application code is implemented based on these general components, this minimizes the impact of changes in application requirements on the framework itself. The framework can also be divided into multiple layers, with the underlying layer being the General layer, the layers on the general layer add elements related to different layers of applications step by step, so that the workload of code modification after an application changes can be minimized without holding the entire body.

 

The application framework has these advantages, but its most exciting advantage is that it provides a unified "stage" and coordinates the internal interaction of the "actors" performing on the stage, for the growth of "actors", the framework also provides a training model and many additional help.

The difficulty of Application Framework Design lies in how designers can grasp the commonalities and characteristics of various applications, abstract general logic based on these commonalities and characteristics, and reuse them; how does the framework designer determine the general points and extension points of the framework, and whether the abstract degrees of these general points and extension points are reasonable?

The analysis work at the beginning of the application framework design is very abstract. Therefore, it is very difficult to design a perfect framework content at the beginning, except that developers have a complete requirement design at the beginning. In many cases, the Framework designer must change and adjust the design at the beginning of the general point and the expansion point. After the preliminary design of the framework is completed, as the new application component is added to the framework or the existing framework component changes, the designer needs to modify the framework so that it can adapt to the new changes. Therefore, framework design is an iterative process. Designers must constantly analyze, design, implement, and test the application requirements, the prototype of the framework can grow into a robust, flexible, and highly scalable platform.



2 XinChen, Application Framework Design and Implementation --. NetPlatform, Beijing: Electronics Industry Press2006

3 Christian gross,. net2.0Pattern development practices Beijing: People's post and telecommunications Publishing House2007 P5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.