Tangram: Flexible Software Development System Based on MFC Framework
Sun Hui
Tangram is a software development framework based on the MFC class library to address several issues facing Visual C MFC-based software development. Tangram is an open source project.
Website: http://www.appTemplate.com/opencn/
Download address: http://www.apptemplate.com/opencn/downloads.asp
Technical Support Forum: http://www.appTemplate.com/opencn/msgboard/default.asp
Tangram background, motivation and meaning
A typical MFC program is usually an SDI or MDI program. In general, such a program contains a main window derived from CFRAMEWND (or CMDIFrameWnd), if it is the MDI interface, also contains several document templates, and the like. CFrameWnd typically contains one or more CVIEW derived objects, and more complex CFrameWnd also contains layout structures formed by several splitterwnds and several specific style TAB-type windows, as shown below:
(A layout complex Frame window)
(A layout complex MDIFrame window and some sub-window thereof)
A highly eye-catching feature of the modern program is the comprehensive application of the window, which reflects this feature in the IDE of Visual Studio .NET and the MS Office series program. The function is obvious, and the design of complex form is significantly a technical issue. Based on the MFC class library, the corresponding technical problem is particularly obvious due to the lack of RAD mechanisms. In general, most MFC programmers will face the following questions:
First, the customization design of the main form, usually, a program's main form is obviously determined by the outline of this program, and many programming skills are visually associated with the main form, and different programs The main form is usually different;
Second, the design of the document type, one MFC program typically contains only limited document types, which is obviously a defect, and the MFC document design also lacks the RAD mechanism;
Third, in general, the MFC-based program only supports limited CVIEW's derived objects, which not only greatly limits the performance of the program, but also limits the connotation and extension of the program function.
Fourth, secondary development mechanism, lack of secondary development mechanism is a fatal and hard injury based on MFC software;
V. Normally, the default MFC program lacks flexible, powerful extension mechanism, and some MFC-based programs exist depends on the techniques of developers;
Sixth, extensive component connection mechanism, this is the vast majority of MFC procedures;
Seven, built-in user chemical visual design mechanism;
The purpose of the Tangram framework is designed for the above problems, and a TangRAM-based MFC program can have the following basic features:
First, an built-in visual design engine, this engine can design your program's main window, depending on the needs, you can configure a completely different personalized main window for your system;
Second, allowing your program to include the document template in any MFC sense, you can design each template in the way you have obtained;
Third, allowing your program to support any number of CVIEW derived objects and save the data corresponding to the View;
Fourth, allowing your program to connect any ActiveX control and .NET Control, allow users, programmers with CView derived objects, ActiveX controls, and .NET Control design any complex document template; 5, allow your program to have similar MS Visual Studio Tools For office the same secondary development mechanism;
Sixth, allowing your program Natural integration Microsoft Visual Basic for Application;
7. Make your program with a PLUG IN extension mechanism similar to IBM Eclipse mode;
Eight, so that your procedure naturally becomes a super browser;
Tangram and "Public Components"
Under normal circumstances, a specific program requirement either exists a functional component of a certain type of condition, or properly analyzing a suitable development object, for example, a database interface VB6, VB. NET, Delphi is often easy to get started, while expressible HTML is suitable for constructing an infectious interface, C is the territory of masters, a fun issue that a programmer faces: Can I have existed? The strength of the development tool and the existing components to complete some of the details of certain needs, and then integrate the part of each development tool with C means?
(A division of software interface based on the MFC software based on the Tangram framework, the two FORMs are based on VB design, and a view is the derived object of CFormView).
Under the TangRam framework, we define a software component collection called "Public Component Space": We will set the ActiveX control, ActiveX Document, .Net Control, and software components that meet the very weak CVIEW derived objects called "Base" of "Public Component Space", in this basis, a limited element (repeatable) forms a limited element group, and the collection of all such limited element groups is called "public component space", due to "public components" Component Space "The element is included is a limited dimension software component group, so each such limited software component group can correspond to one or more MFC's sense documents (if each such limited software component group is If a geometric layout is matched, it has formed a specific cframewnd. The basic function of Tangram is to make each element in the "Public Components Space" naturally become your natural extension of your MFC technology, from this sense. Each TangRAM-based application is a mathematical representation of elements in the "public component space".
Tangram working principle:
In Visual Studio .NET, we offer a Microsoft technology-based Wizard to generate the MFC code based on the TangRam framework for developers:
After compiling, a blank main window will be generated. If you need a personalized main window, you can select "New Work Space" and you will get a design interface:
(Blank Main Window)
In the toolbox on the left, there is splitterWnd, Tab Style Window Design Tool, you can design your window style:
(MDI main window in design phase)
A specific main window corresponds to a Workspace file, a TangRAM-based MFC program can have any multiple main windows, a specific runtime form according to a configuration file (an XML file) to specify a specific main window and other operations Time information, a typical configuration file as follows:
XML Version = "1.0" encoding = "UTF-8"?>
appsettings>
askBLYBINDING>
runtime>
Mainframeid = "DocumentServer.Appobj" MainframeclientID = "DocumentServer.tabedmdmdMPonent" DocserverID = "DocumentServer.Documents" Ctrlbarcomponentid = "DocumentServer.Controlbar" Enablevba = "false" Vbacomponentid = "tangramvbacomponent.tangramvbahost" SkinComponentid = "TangramskinManager.skinServera" DocViewid = "DocumentServer.docViewConnector" ActiveXobjid = "tangramactivexserver.activeXobj.1" AppGUID = " 5F8CF6E1-5BF8-4FF8-A33D-BDD9DA6D3CEC ">
Tangram>
configure>
If you are familiar with the .NET program deployment, you can see that this is the default configuration file of the .NET program,
(Design new template)
(Generate a new document according to the design of the design)
Tangram provides a sub-document mechanism within document composite technology documents, enabling users and developers to design a functionality, complex document (similar to the Frame mechanism similar to the HTML page). Tangram and Secondary Development:
With an extension plugin, Tangram provides a step-by-step VBA integrated mechanism: in a specific configuration file, by specifying enablevba = "true", a running timber can support VBA integration, at this time, the document in the meaning of each Tangram is naturally Generate a VBA project:
(Tangram generates a VBA project for each document through plugin technology)
In addition, Tangram provides secondary development mechanisms outside VBA. Tangram's subsequent versions will support more secondary development engines and description engines (including XAML)
Tangram and program personalization:
Tangram provides users with sufficient personal customization, developers can provide flash-based splash for a particular system, allowing users to interact with HTML, Flash into the program and with program instructions, for example, users can provide HTML for MDI programs Background or Flash background to enhance the appeal of the program, users can add their own interface elements in existing systems and further integrate new functional units, especially, we provide a plug-in to connect the user to the STARDOCK's skin engine.
Tangram components and Plug in:
By expanding plugins, a TangRAM-based MFC program can use the vast majority of ActiveX controls in its template, so that VB6-developed ActiveX Ctrl / ActiveX Document can be used as TangRAM plug-in, based on .NET Framework development Any control can also be used as a TangRAM plugin. In the Tangram framework, we offer ATL and MNAGED C MFC View Wizard to provide developers with C plug-in development mechanisms. TANGRAM provides Tab Style Window Extension Plug-in Development Mechanism, which in theory, TangRAM-based MFC software can support any Tabbed window. Through the plugin mechanism we provide, developers can achieve the separation of business and interfaces.
TangRam and .NET Framework development:
Tangram provides a super control that makes Tangram development documents can be used as a FORM or .NET control of other .NET programs:
(TangRam document is used for C # program development)
(Tangram technology is used to implement the main window of the C # program)
Tangram and General Document Design Engine:
Tangram essentially provides a general document constructor, in this sense, Tangram provides the application level MFC visual design mechanism, which greatly facilitates the construction of the application document, in fact, every TangRam-based system The main window is also implemented as a document that can be designed by an editor. Through the TangRam framework, we have a meaningful step to the direction of application documentation.
Tangram and B / S development:
Tangram passes a natural host IE kernel through the plug-in mechanism, which is an extended browser, especially, we offer the expansion of the HTML model, so that the HTML script can directly execute the Tangram program object instruction, TangRAM-based MFC program can become B / S, C / S double feature application system.
Tangram with Java
Through a third-party plug-in, TangRAM-based software can support Java-based secondary development, specially displayed JFRAME objects directly as a C ViewTangRam's future
We hope that Tangram can develop integrated application frameworks similar to IBM Eclipse types based on Microsoft technology platform. We have a long way ...
Other articles:
Tangram and software combination constructive software flexible use Tangram to construct your own software development platform (1) (see My Blog) Tangram Screenshot (1) Tangram Running Time Screenshot-2
Tangram Download: http://www.apptemplate.com/opencn/downloads.asp
Technical support: http://www.appTemplate.com/opencn
Technical Support Forum: http://www.appTemplate.com/opencn/msgboard/default.asp
Contact: sunhuizlz@hotmail.com.