
|
Our Solutions »
Custom Application Development » conclusion©
conclusion©
Generating UI Components
Decide's Conclusion has the ability to generate components based on other components. The resulting code blocks can represent either a new Windows form or a new web page based on which screen is used - the Winform generation screen or the web page generation screen. Both screens work in a similar fashion although their templates will differ and therefore their "Fields" customization grids may prompt the user to make different customizations. Generated code can be in any language that Conclusion "templates" support, currently C# and Visual Basic. There are four steps for accomplishing this:
Throughout Conclusion the code generation screens all take the same format. They can be accessed from the Main Menu's Generate menu. A menu will pop up with three tabs. The first tab allows users to choose from a list box on the left to select the source of code generation and to select templates from a box on the right. Under the Source checkboxes there will be buttons:
Once the user clicks the button they are prompted for the path to a DLL file. Once a DLL is chosen, Conclusion analyzes the DLL to find all the relevant methods that may be used as a source for code generation. A "Gather Method Data" window pops up to allow users to review/customize this information.
The previous screen shows a DLL that represents a data layer that accesses the TestCRUD web service. Web service DLLs automatically have several methods that are not useful to Conclusion and they can be excluded by clicking the "Exclude Web Service Extras" button to deselect them. The "Parameter Prefix" textbox in the lower left is also important. When the method in the data layer component gets invoked, it returns a DataSet or DataTable with particular column names. In order for Conclusion to "generate" the code in the UI components for calling these methods, it needs to know which returned columns match up with which method parameters. ***IMPORTANT*** Method parameters need to be named by the same name as the data columns or be the same name with some particular prefix so that they can be matched up. Conclusion generates method parameters in this format "@_{col name}". All data layers used by Conclusion must conform to the {Prefix}{col name} format. On the Gather Method Data screen users must configure the prefix used by the method parameters. The "Classification" column allows users to configure what CRUD data operation the method handles. Conclusion "guesses" at the method type based on its name so the user should review all of these and make changes where needed. All methods included in Conclusion must be configured with this classification or else the user will be prompted to make a change because methods of an Unknown classification cannot be used by Conclusion. When the user clicks OK, the generation window's data layer list is ammended with all the new methods from the DLL. Merging Data Layer Components to Templates A Windows form or web page has various needs in terms of data operations and those needs are reflected in their templates. A Winform Edit Details page template, for example, has a need to "Get" one record of data, "Save" one record of data, and possibly delete or add a record of data. When generating UI components care should be taken by users to select data layer components that offer those data operation. Specifically, Conclusion's generation process matches up particular parts of the template with methods of that "Method Type". For example, an Edit page template may configured say "the 'SELECT' method code goes here" and then, for each data layer method selected, the "SELECT" method from its parent data layer component is used as the basis for generating that part of the UI component code. Since understanding the relationships between templates and Method Types is so important to successfully generating good UI components, Conclusion aids the user by offering a filter to the data layer list. The list can be filtered to all SELECT methods, for example and then the user would choose the desired templates that have the need for SELECT operations.Once selections have been made the user can click the Next button to bring up the Methods tab for customizing UI generation output.
The first time the Next button is clicked for a selected method, the user may see the Gather Data screen. This screen allows Conclusion to actually run the method to see what data is returned so the data that a method returns can be registered with Conclusion. Within Conclusion it is possible to customize what fields are involved in the generated UI components. The Fields tab of generation window will have one tab for each selected template. On that tab will be a grid where users can configure which fields should be involved. They can also configure the source of the data for drop downs by making a selection from the lists in the dropdown column. These data sources come from the source data layer methods which are marked with a Method Type of "LIST".
The previous picture shows an example of how to configure fields. Once the fields have been customized (if needed) the user can click the Generate button to generate the stored procedure scripts. The Code tab will pop up. The code window shows all the generated code for all the selected items and templates. After generation they still only exist in memory but users can click the Create Files but to write the code to individual files in the Conclusion Results folders. The results folders are configured in Project Setup screen from the Main Menu's File menu. Conclusion Ver 1.4 - WGU 3/10/2005 |