First use of Exe+bpl+dll project summary

Source: Internet
Author: User

Some time ago to study the development of the BPL way, just recently there is a small project, so try a bit, the project has been completed. Have some experience and experience, write down with you to share, please put forward insufficient, in addition, in the study of BPL friends, there are problems can be discussed together, in order to go faster. A summary of a project (Exe+bpl+dll mode) has been used in a separate EXE file way to do the project, then the feeling is convenient, do not consider too much, all the business logic functions, compiled into an EXE executable file is OK, Because has not studied BPL this kind of framework programming, recently studied, the feeling is very deep, this mode is more convenient. And for the team mode is more convenient, as long as the BPL of each team to get to complete.  Based on this idea, recently applied to a new project, has begun to bear fruit, the project is summarized as follows: first, planning BPL framework programming is very important, a project to be divided into N BPL, each BPL role, division of labor in the analysis must be determined, this is very important. The project is divided into the following packages: (1), DBCOMMON.BPL---data module package, including data module, database reading and writing class module (data Access Layer) (2), PUBCOMON.BPL-to-public function, process unit, common variable unit, custom structure type unit, Custom class Units (3), BASEFORM.BPL----all Forms base class units, business logic base class form units on the basis of (3), according to different business logic, set up different business packages, example: A.BPL,B.BPL,C.BPL ... (4), A.BPL---Business Pack 1 (5), B.BPL--Business Pack 2 ... Create different business packages based on the classification of business logic. Second, the application of the design package is sequential, some basic packages must be established first, so that other packages are applied at the time of establishment, the base package after the modification, all the application of the base package must be recompiled, and the order can not be mistaken. Example: DBCOMMON.BPL-->BASEFORM.BPL-->A.BPL when DBCOMMON.BPL is modified and recompiled, the next two packages must be recompiled and compiled BASEFORM.BPL first, then compiled a> The BPLBASEFORM.BPL package contains the base class form cell for the entire project, as well as the business logic base class form cell inherited from the base class form, which unifies the style of the entire project in the base class form cell, including the font, the styles of the controls including the third-party controls, the colors, and so on. What should be freed when the form is closed, and so on. And the related style of the base class form, the style is by the main program EXE in the initialization of theLine layout, so if you want to change style, just modify the relevant content in the common variables unit. (Note: This item does not use the skin, only through the color and other styles of control) Example 1: In order to make the style of devexpress components consistent with the style of the whole project, especially tcxgrid in the selection of DXOFFICE11 style color,    Because the DXOFFICE11 default color is the kind of dark blue, in order to make the color of Tcxgrid with the whole project color matching, it must be adjusted, including the color of the line, this setting in the EXE initialization was arranged, so the overall effect is more ideal after the design. Example 2: The project also uses a third-party control RZ component, which is also a good three-party control, this control also has a good style of unified control, as long as the control can be combined with the style of the project. Examples of Trzframecontroller, Trzmenucontroller, etc., are used in order to unify the style. By setting the styles of these two non-visual controls, you can reach all controls that use this style. and the main program as long as the initialization, set their style can be achieved once and for all. Third, the call framework determines that the package function is complete, the rest is the main EXE loaded into the BPL run. Load packs are divided into dynamic and static modes. According to the planning of the business, three basic package dbcommon.bpl,pubcomon.bpl,baseform.bpl are static loading, which is added as the running package that must be used when the main EXE is compiled.    The other packages are dynamically loaded read runs based on business functions. Dynamic loading shows the form in BPL in two ways: one is fused on the pagecontrol of the main EXE form, and the other is the ShowModal mode.   These two ways can be adjusted, as long as the table in a database to modify the field, you can achieve the effect without modifying the main EXE, this arrangement is really convenient. Used to do independent EXE program, all through the tactionlist manually set all the functions, and then with the menu, button binding (set action), the workload is really very large, the project does not use Tactionlist, Instead, it realizes all the functions through a ttreeview, when the main EXE runs the Read permission function, reads the function permission table once, loads the allowed permission to Ttreeview, and records the BPL name, the form class name and other contents by defining a record type. And with the Ttreeview data processing, when clicking on the Ttreeview node, read the data of the node, as a parameter to load the specified BPL and display form form. This approach reduces the number of accesses to the database and is handled dynamically. From this thought, if you extend the functionality of the project later, as long asBy copying the new package to the relevant path of the system, the main program can automatically load and display the function form. The only thing to do is to define it in the table of the database. Such a framework arrangement lays the groundwork for a smooth expansion. In this project is also made the attempt to invoke the form in the DLL and be successful. Display the form in the DLL also in two ways, one is fused on the main EXE Pagecontrol, the other is the ShowModal mode. Both of these modes handle the effect of moving the carriage down. However, the form of the two modes, in the form of the Popup "know" the way the difference is greater, because different from the form in the BPL, can be very convenient operation.  For DLL forms fused on Pagecontrol on the main exe, when the form is closed, the main EXE is notified by sending messages to the main EXE to release the dynamically established Tabsheet. Iv. experience through the development of this project, in-depth application of the data property of the Ttreeview node and the record type of the variables of the mate.   Other objects were previously stored on the data in the actual project because the data itself is a pointer type, so exploiting its potential can be a good result. form of the application of the fusion technology in different situations, the operation is still not the same, the example of common forms of fusion, BPL form of fusion, DLL form fusion, the three kinds of fusion in the actual business difference or exist. In particular, the pop-up form "know" and its operation, this is still a need for skills, fortunately, the three ways of operation have been successfully used. The use of the Tframe framework does bring inconvenience to the project, reducing a lot of work.   Tframe put in the BPL of the application is generally the use of dynamic loading mode, of course, its position on the form is to be arranged beforehand, the dynamic establishment of the tframe by the other controls in the window will take some time to do a good job. Database access through a database access class to reduce redundant technical content of the code, improved a lot of efficiency. Through the development of this project, for the future work accumulated a lot of knowledge points, at the same time accumulated some of their own library.   For future development efficiency will bring a lot of help. Because it is the first time to formally do the BPL structure of the project, has not accumulated experience in this area, the feeling is the release of the time or trouble, to determine with the project with the release of the BPL package, or prepared for 20 minutes, the final fix. In the online search, there are netizens suggested the package merger, this will have time to try again later

First time with Exe+bpl+dll project summary

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.