SEARCH WITHIN CONTENT
Citation Information : International Journal of Advanced Network, Monitoring and Controls. Volume 3, Issue 1, Pages 58-61, DOI: https://doi.org/10.21307/ijanmc-2018-010
License : (CC-BY-NC-ND-4.0)
Published Online: 07-May-2018
This This article presents a quick way to develop your system with custom components in Delphi. Use the above method can minimize code duplication, improve work efficiency. In this paper, we apply this method to the development of information management system in a university based on the Data Snap three-tier architecture. Through practice, we find that the workload of the original three months, and we only need 20 days to complete. Therefore, adopting the rapid software development method based on component design proposed in this paper can not only shorten the programming time of management systems such as ERP and information management by more than two thirds, but also bring great advantages in system development.
With the advent of the information age, we are more and more inseparable from technology. Now developed a lot of PC software such as information management systems that can help people save a lot of manpower, material resources. Especially every year at the end of annual work statistics, the design of a set of software through the relevant settings for automatic statistical calculation, approval, access and other functions is necessary. The completion of the software can be fully realized at any time computer statistics automatically calculate the workload of a variety of teaching and research, but also can effectively avoid errors in the calculation process.
There are a lot of software that uses a lot of languages to develop the PC end now, but to the visual software development, this text uses Delphi to finish. And Delphi is a powerful, Windows-based environment, object-oriented visual application development tool. It combines the power of the traditional programming language Object Pascal with the database language for both traditional arithmetic programming and database programming. The Data Snap technology system in Delphi provides a mechanism for transferring database information between the client and the application server. Meanwhile, the rich component library brings great convenience to the program design. Delphi has become one of the most popular visual software development tools today.
When we used Delphi to develop PC software, we developed a way to customize the components to complete the software development and make the program completed in three months and we only need 20 days to complete.
In a system development, design a custom component. In the process of system development can be based on the analysis of needs sorted out the same part of the logic function, the use of custom components to complete the corresponding function. Therefore, anytime, anywhere custom components into different needs of the interface according to the corresponding function, reduce code duplication and greatly facilitate the development of programming speed.
In an ERP system to do needs analysis, we will find a lot of repetitive logic requirements, For example: doing computer college information management system, whether it is to deal with college business or teachers related to the operation, there are for the basic data to add, modify, delete and so on. That by designing custom components: Add button to complete the corresponding function, into the page you need to complete its specific functions and greatly reduce the programmer’s efficiency.
DElphi component is an object library, but also a class. The base class for all objects in Delphi is TObject, and the most primitive base class for a component is TObject, as shown in Figure 1.
The hierarchy of components in this structure is: TObject ----> TPersistent -----> TComponent -----> TControl.
TComponent, the base class for all Delphi components, inherits from this class for all object libraries that you want to register directly with the IDE for visualization. TComponent provides the necessary information to make the component work on Delphi’s IDE. Then TComponent derives the TControl class, which is the base class for all flagship visual controls. All of our components are based on TComponent.
In the development of custom components we need to analyze a page needs and then do some work:
Data acquistion: In general, we are all custom components that design functionality, and we need to get the data or output the data. In each page there will be a lot of data-type components, how do we find the corresponding data components, you can design components by the naming rules to find the corresponding data-type components. For example: Set the settings in the component, to the components of a unified naming rules such as: cktext1_XXXX,XXXX for the database table field names, according to cktext1 can find the components needed, according to the XXXX components and database fields correspond.
Data transfer: Passing data using JSON. JSON is a lightweight data exchange format based on a subset of ECMAScript that stores and represents data in a completely independent of the programming language. There are only two structures in JSON: Objects and Arrays JSON values consist of numbers, strings, logical values, arrays, objects, null, and so on. Using JSON as a data exchange format between the client and the server, the JSON data format can be used directly by the server, greatly simplifying the code development of the client and server, and easier to maintain. And the data format is relatively simple, easy to read and write, the format is compressed, occupy a small bandwidth.
Mutual exclusion between functional components: When the button On Click is executed, in order to avoid data confusion, you must make the button is not related to the button is invalid. For example, when you click the Add button in the information management system, the buttons, such as modify, delete, archive, data export, return, etc., must be inactive. The Save and Cancel buttons must be valid. 2 When the save or cancel button is clicked, buttons such as add, edit, archive and return should be valid, while save and cancel buttons should be inactive. Therefore, the entire information management system interface point of view, in addition to archiving, data printing, return no mutual exclusion, the other buttons need to be mutually exclusive with other buttons.
There are many custom components in a page, but we need to know the current step to the program flow, the current table, the current operator, the current name from the table, and others. Then we need to design a custom template components on each page, template components design attributes as shown in Table 1:
After the preparation of the above two parts, the process of custom components in Delphi contains the following steps:
Create a library unit that contains new parts.
Member has inherited a new type of component type.
Add properties, methods and events.
Register parts with Delphi.
Create Help files for the component’s properties methods and events.
Custom components such as adding components The main code is as follows:
This experiment is in the computer system of information management system for experiments, the test results are as follows:
Custom Component Testing: A custom component of this article appears in the Delphi Visualization Toolbox: Figure 2
In the page, drag the custom components to complete the corresponding function: Figure 3
According to the method of using custom component design in software development, the following advantages and limitations are obtained:
Using the custom component technology, the management system model was initially realized, the idea of software reuse was realized, the phenomenon of repeated encoding was reduced, and the software development efficiency, maintainability and scalability were improved.
The use of custom components in the information management system and the related operation of each page through the related parameter settings are feasible and safe.
for the development of a set of software, through the development of custom components greatly reduce the development cycle, a great use of value to the actual development of software.
This method of custom components in the development of software generally for the role of ERT system, for some web version of the software is not very effective.