This tutorial will walk you through each step of creating your own business logic layer classes using the Quick Objects Designer application.
Quick Objects Designer application can be used to retreive the database schema from either Oracle or SQL Server database. The schema information can then be used to modify and specify Quick Objects Framework related properties. Then this information can be saved in a project file which can be opened later for modification or code generation.
Lets start by creating a blank project in Visual Studio (or IDE of your choice). This project can be either a class library, WinForms, Web Application project or a WebServices project. Essentially any project type that you can create and use classes in! We suggest creating a class library but it is completely up to you to decide how you would like to organize your code and classes.
Let us start the Quick Objects Designer program (Available under the Start -> All Programs -> Akal Tech - Quick Objects V2 menu).
From the Settings menu choose the "Manage Connections" menu item and now you will see the following screen.
This form lets you add/modify database connections for the databases you would like to create applications for. In our case we will be connecting to the QO_SHOP database on the SQL Server Express instance. Clicking on Add New button will open another dialog that will let you enter a Name and the connection string for your database.
In our case we are going to use the QO_SHOP as the name and the appropriate connection string.
After entering the Name and Connection String values click the OK button. Now we will test the connection to ensure the provided connection string actually works. Choose the appropriate database type from the "Choose database type" drop down, in our case it is SQL Server 2005. Then click on the Test button and you will get a message indicating that the connection string works or not.
Click OK button to save your newly created connection.
Now it is time for us to create a new project by loading the QO_SHOP database schema from the database server. Click on the Projects menu and then choose Load From Database.
Now lets choose the QO_SHOP connection string we saved earlier, and click on the OK button. This should load the database schema into the environment.
Now simply right click in the Tables list and then click on "Select All" option. This will check all the tables in the List, it will also check all the fields on all the tables. If you do not want a table to be included just uncheck it.
Now lets specify the Project properties. Project properties are located in a Tab on the right side. If you click on the Project Properties tab you will see a screen like the ones below.
| Custom Class Files Output Path: | This path is used as the path where custom class files will be generated. |
| Base Class Files Output Path: | This path is used as the path where base class files will be generated. This path may or may not be the same as the path for the Custom Class files. |
| Custom Template for Classes: | This can be used to specify a custom template for custom classes (optional). This is not necessary but provided as an option in case you create a custom template as per your needs. |
| Custom Template for Base Classes: | This can be used to specify a custom template for base classes (optional). This is not necessary but provided as an option in case you create a custom template as per your needs. |
| Namespace: | All the generated classes will be inside this Namespace. |
| Author Name: | This name will appear in the comments at the top of each generated class file. |
| Modification Date: | If you choose Auto as the option, then the current date time value will be used in the comments. Otherwise you can choose a date of your choice. |
| Parent Objects Postfix: | All the related (parent) objects (based on related tables that have a parent relationship) will have this value added at the end of their name. |
| Child Objects Postfix: | All the related (child) objects (based on related tables that have a child relationship) will have this value added at the end of their name. |
| Base Classes Postfix: | This value will be added at the end of each class's name to create the base classes. |
| Make Class Name First Letter Uppercase: | If this is checked, all generated class names' first letter will be upper case and the rest of the letters will be in lower case. |
| Naming Convention For Related Object Properties: |
This drop down has three choices: FieldName_RelatedTableName, RelatedTableName, ConstraintName.
|
| Prefix For Join Methods: | This value is used as a prefix when creating helper methods that let you create joins between various objects. The methods are named in this manner: JoinPrefixValue_FieldName_RelatedTableName or if you selected RelatedTableName in the naming convention the generated method name will be JoinPrefixValue_RelatedTableName. |
| Generate Documentation: | This includes Summary xml tags inside your class files. |
| Source Code Target Version: | If you will be using the code in .NET 1.1 then only use .NET 1.1 as your option. However if you will be using the code in .NET 2.0 you can use either of the options. However code generated with .NET 2.0 option is not compatible with .NET 1.1 as the code will generate attributes that were not part of .NET 1.1 framework. |

Click to enlarge