What Is Structural Software?
Software structure (Software Structure) refers to a hierarchical table condition, the process, method and representation of software by software components. Software structure mainly includes program structure and document structure. Program structure has two meanings. One refers to the data structure and control structure of the program; the other refers to the process, method, and representation of the program by the program units (modules) one level lower than the program. In the latter sense, there are two types of block structures and nested structures. The block structure is relatively natural, and the various parts are connected through some common variables. The nested structure is based on the nested subprograms to introduce locality and dynamics to reduce the initial amount of information in the program. It is inconvenient to debug.
- Chinese name
- Software structure
- Foreign name
- Software Structure
- Composition
- Processes, methods and representations for building software
- mainly include
- Program structure and document structure
- Software structure (Software Structure) refers to a hierarchical table condition, the process, method and representation of software by software components. Software structure mainly includes program structure and document structure. Program structure has two meanings. One refers to the data structure and control structure of the program; the other refers to the process, method, and representation of the program by the program units (modules) one level lower than the program. In the latter sense, there are two types of block structures and nested structures. The block structure is relatively natural, and the various parts are connected through some common variables. The nested structure is based on the nested subprograms to introduce locality and dynamics to reduce the initial amount of information in the program. The nested structure is not as intuitive as the block structure. It is inconvenient to debug.
Software Structure Introduction
- The so-called module refers to a relatively independent set of program objects such as data descriptions and execution statements. Each module in the program needs to be named separately, and access to the specified module can be achieved by name. In high-level languages, modules are specifically represented by functions, subroutines, procedures, etc. A module has four characteristics: input / output (interface), function, internal data, and program code. The input / output is used to realize the data transmission between the module and other modules, that is, the required raw data is passed to the module and the result data is obtained from the module. Function refers to the work performed by the module. The module's inputs / outputs and functions constitute the external characteristics of the module. Internal data are local quantities that can only be used inside the module. [1]
- Some programs have a single-module structure, and some have a multi-module structure. These modules are inseparable in the logic of the program, can be written in different programming languages, can be compiled by corresponding compilers, can be combined with other program units and loaded into the computer to run. Because of the need to write large programs, and modules can be used multiple times, modularization is a good way. A large program composed of a set of modules can have three structures, that is, a sequential structure, a concurrent structure, and a distributed structure. The program with sequential structure is the oldest. The programming language used is sequential programming language, such as ALGOL, FORTRAN, C, etc. A program with a concurrent structure consists of several modules that can be executed simultaneously. These modules can be executed in parallel on multiple processors or cross-executed on the same processor. The programming language used is a concurrent programming language, such as concurrent PASCAL, Modula-2, and so on. The program of the distributed structure is composed of several modules that can run independently. These modules can be distributed in a distributed system and run on several computers at the same time. The programming language used is a distributed programming language. For large programs, a mix of these three structures is also possible.
WEB Software Structure Web Software Structure Principles
Heuristic rules for software structure design
- (1) Improvement of module functions
- Executing the prescribed function part; error handling part; when the data needs to be returned to the caller, return whether the end flag is correct.
- (2) Eliminate duplicate functions
- (3) Limit the influence of the module to the control range of the module
- (4) Moderate depth, width, fan-out and fan-in
- (5) The module size is moderate
- The module is too large: the intelligibility has decreased. Module is too small: the overhead is more complicated than the effective operating system interface.
- (6) Reduce the complexity of the module interface
- The interface passing information should be simple and consistent with the function of the module.
- (7) Predictable module functions
- The module is considered as a black box, the same input produces the same output, and its function is predictable. Modules have internal states and their functions may be unpredictable. Difficult to understand, difficult to test, and difficult to maintain.
- (8) Avoid ill-conditioned connection of modules
- Prevents pointing to branches or references in the middle of the module (for content coupling).
- (9) Package software according to design constraints and portability
- Packaging refers to the technology used to assemble software for a specific environment. [2]
Software structure directory structure is clear
- The directory structure is clear, should not be too deep, complicated, and the path is best to use relative addresses
- What kind of directory puts what kind of content, so that it is easy to manage, so that the directory structure of the WEB program is clear, and at a glance, you can know which functional modules and content are stored in a certain folder. If you store it casually, you will never know what a directory is used for. For example, the frequently used executable files should be stored in the (project root directory) root directory. This is mainly to facilitate understanding of its role, and to enter fewer address characters in the program. The pictures used by the program are stored in the images directory under the root directory. If the project is large and has many branches, you can create a directory name that is also related to the branch program in its directory to store the relevant picture content. The configuration file of the program and the common common function class inventory are placed in the include directory. The extension of the function library file stored in this directory must be named: .php must not be named .inc.ini , Mainly to prevent such files from being available for users to download, or to view their source code content, so that it is convenient and clear to call them. The template files should be stored in the templates directory under the root directory, with the extension .html. If the project is large and classified, the template files can be stored in the lower directory. Temporary files are stored in the root tmp directory, which is usually set to be readable and writable by anyone. The use of relative addresses is mainly to facilitate program migration.
Software structure appropriately named
- Naming is best based on what the program does. If a word needs to be described, use lowercase words to name it. If you want to use multiple words to represent it, use lowercase words to connect them. It should be noted that the name should not be too long, which is inconvenient. Although it can be expressed more clearly, it is difficult to type. The function name can be the same in the program.
Software structure often changes content, interface makes templates better
- It is better to use templates for frequently changing content and interfaces. If the content of an HTML page is placed in a program to process input according to traditional production, it is more troublesome to change the program, which may cause greater inconvenience.
Software structure shared public information unified storage
- The common information is stored uniformly. This is mainly to facilitate the most common functions that can be called when the team develops. It is not necessary for each developer to copy a copy or write a copy in the program file. This wastes space and is efficient. The effect is not good.
Include Software structure Include files can not be embedded more
- Include files can not be embedded more, this is because every time a program includes a file, it is necessary to open and read this file, which takes time, and that is, it may encounter difficult BUG when processing the path problem.
Too many content files cannot be stored in the software structure directory
- If there are many files and large files, it is better to deal with the directory and drive letters.
Software structure data structure should be designed properly
- The data structure should be reasonably designed and concise.
Software structure data verification should be on the server side
- Data verification should be on the server side, but there are other disadvantages to doing this, that is, when the amount of data is large, the server will run under load, and auditing the integrity of the data can cost time and system resources. The client will not consume too much resources on the server, because it is the user's resources.
The software structure connects to the database late and disconnects early
- Connect as late as possible and disconnect as early as possible to minimize the use of system resources and provide conditions for the next connection.
SESSIONCOOKIE Minimize the use of SESSION and COOKIE in the software structure
- Use SESSION and COOKIE as little as possible, because using SESSION consumes system resources, SESSION is stored on the server, and each time you read the data in SESSION, it takes a lot of overhead. Although COOKIE does not occupy server resources, COOKIE is not very secure.