Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Function and function-oriented programming

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Since the advent of the computer, the development trajectory of computer hardware and software is completely different. The development of computer hardware can be described as magnificent, from electronic tubes and transistors to integrated circuits and large-scale integrated circuits, CPU from single-core to multi-core, displays from electronic screens to liquid crystal screens, hardware technology and products are constantly updated, and hardware productivity continues to develop by leaps and bounds. However, computer software has been developing at a slow speed. Although the programming language has developed from two-mechanism and assembly language to high-level language, and a variety of software technologies and frameworks continue to emerge, the improvement of software product productivity is very slow. Looking back at the development speed of computer hardware productivity and software productivity in the past two decades, we will find that the development speed of software productivity is far lower than that of hardware productivity.

By analyzing the root cause of this huge contrast, we can find that the development of computer hardware is standing on the shoulder of the giant of industrial production, while computer software is still in the stage of low-level handicraft production. Isn't it? When a software product is required, it is necessary to set up a team to be responsible for all stages of the software product production cycle, such as software requirements, design, development, testing, installation and deployment, and programmers are required to write code line by line to realize the functions of the software products. the next software product development, repeat the above process, without exception The industrial concepts of socialized division of labor and cooperation, standardization, modularization, rapid iteration and large-scale production are rarely seen in the production process of software products. Therefore, the current software development is still in the handicraft production stage.

The future and development trend of software lies in the industrialization of software production. Some people say that the software is too complex, and a series of problems such as various dependent packages, version control, protocols and programming languages make it almost impossible to achieve industrial production of similar hardware. But where does the complexity of this software come from? For software developers all over the world, there has never been a unified specification to restrict their development process. File names, method names, parameter variables and so on are defined casually, and there are no constraints on data storage and return values. in this way, the developed software is difficult to reuse and interconnect. Various programming languages have their own coding specifications, and which software product these coding specifications play a role in depends on the consciousness of the development team or developers. Therefore, the complexity of software lies in the lack of an industrial specification to restrict the development and production of software products.

So, is software industrialization really difficult to achieve? We abandon the idea of software complexity and look at how to use function and function-oriented programming to realize the industrial production of software.

Before expounding the function, let's clarify the difference between the function and the components (components) in the current software development.

First, look at the components in a software product, as shown in the following figure:

As can be seen from the figure above, although the components in "Software 1" can achieve some of the functions of the software product, the gray area in the image above requires the software developer to write code, file configuration and other operations line by line as a binder. glue these components together to produce a software product. The development of the next product "Software 2" is no different from that of "Software 1", as shown in the following figure:

What if you develop a "Software 3" that contains some of the components of "Software 1" and "Software 2"? Look at the following picture:

As can be seen from the figure above, even though some of the components of the first two products can be applied directly to Software 3, the work in the gray area is essential.

Next, let's take a look at the ideal composition of "Software 1". Take a look at the following figure:

As can be seen from the picture above, "Software 1" is made up of 3 functions and there is no gray area. If you develop another product, "Software 2":

As can be seen from the above picture, the function X in Software 2 does not need to be redeveloped, which will save a lot of work. Similarly, what if the development product "Software 3" includes some of the functions in "Software 1" and "Software 2"? Look at the following picture:

As can be seen from the above figure, as long as the functions in "Software 1" and "Software 2" are combined, "Software 3" can be formed without gray areas, that is, without the need for developers to write code and file configuration line by line. The production of "Software 3" has been completed. If "Software 1" and "Software 2" are implemented by different teams, it will better reflect the advantages of function technology over traditional component (component) technology.

Let's take a look at what is function and function-oriented programming: function, referred to as Func, the full name of software function, that is, software function module; function-oriented programming, referred to as FOP, namely Func Oriented Programming, which takes the "function specification" as the specification for the development of software products. Here, put aside the technical implementation details, look at a software product from the perspective of the business as a whole, which functional modules the software product contains, these functional modules can be defined as functional components, that is to say, only the combination of these functional modules, can generate this software product.

Take the Jamobo2 project as an example to illustrate how to use component technology to develop a software product:

As can be seen from the above picture, the entire file structure of the Jamobo2 software project, according to the requirements of the "function specification", all the functions are located in the f directory, and each function is in a software project, there is only one, the function consists of a function master file and a function home directory. The above Jamobo2 project has the following functions, of which the underlying functions are: Authorization (authorization), Setup (installation), User (user), X (public class), and display layer functions are: AlertPage (prompt page), SetupPage (installation page), UserPage (user page), XPage (home page). Composed of these functions, you can see that the Jamobo2 Web project or this software product contains the main functions of "installation, home page, user, authorization, prompt page". The details of its internal implementation will not be detailed, please visit Functree.

Based on the above, you can summarize the following advantages of function-oriented programming:

1. The development cycle is short because you don't need to write lines of code as glue and you don't need a lot of configuration files.

two。 The function is located in a directory (space), which allows developers to quickly grasp the functional module composition of the software project and reduce the complexity of software product upgrade and maintenance.

3. When developing a new project, you can directly transfer the functions of other projects directly to use, and you may need only some small modifications or no modifications to apply to the new project.

4. Such a simple and standardized function tree structure will greatly reduce the difficulty of automatic development, testing, deployment, operation and maintenance, so that it is easier to develop some automation tools to assist all stages of the whole software product life cycle. further improve development efficiency and shorten the construction period.

5. The development of functional components liberates developers from two aspects: horizontal (regional) and vertical (time), so that people in different regions, different time points, and who are good at different professional fields can cooperate together to achieve socialized division of labor and cooperation.

In the process of function-oriented programming, we need to pay attention to the following problems:

1. The development of functional components according to the "functional specifications" will lead to the reduction of developers' freedom of development, which is a necessary condition for standardized, industrialized and modular production of software products.

two。 Some software frameworks can not be used, or need to be modified to meet the requirements of the "function specification", there will inevitably be questions and arguments about rebuilding wheels.

3. In a software project, the inheritance relationship between functions should be reduced as much as possible, the self-inclusion of functions and data should be achieved as far as possible, and the dependence on other functions should be reduced, which may lead to the increase of the size of software products.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report