| Welcome to CodeImprovements.com |
|||||||||||||||
|
|||||||||||||||
Database Tier * BoB.NET produces a table class for each table that is selected to be included in the project. This class represents and contains the data for a single row of the table. * One or all of the tables in a database can be selected to be included in the code produced by BoB.NET. The only requirement for a table to be selected is that it must have a primary key. * The code that BoB.NET produces is user-selectable as either C# or VB. The code produced is written for .NET 2.0, and will not work on previous versions. * BoB.NET automatically adds all produced classes into a new user-named directory in the selected project, and updates the project file to include the new classes into the project. * The user can choose between producing code that uses stored procedures to interface with the database, or code that uses discrete SQL commands to perform that function. * If stored procedures are chosen, then the stored procedures themselves are created and inserted into the database by BoB.NET, using a user-designated prefix to keep all of BoB.NET’s stored procedures grouped together. * Stored procedures written for BoB.NET include TRY/CATCH blocks, and will insert an exception's information into a BoB.NET created DBError table. * Each table class creates all of the database fields as private variables, and exposes each variable through a public property. * Each table class provides basic CRUD functionality (insert, update, select and delete) and thus is responsible for its own interface to the database. It also provides clear functionality. * Each table class also provides complete functionality for database transactions. These transactions are not used for the table class CRUD functions, but will be utilized when these table classes are combined into a business object where transactions will be necessary. * A save method is provided in the table class. It checks the database for the existence of the primary key, and will update the row if it's found, or insert a new row otherwise. * BoB.NET provides functionality to add additional select methods into the table class when the SQL or stored procedure will only be accessing the table represented by the table class. * A bare constructor is provided for each table class, as well as a constructor which will accept the primary key fields and automatically fill the object from the database upon creation. * Dirty flag functionality is built into each table class. * Complete field validation is built into each table object if desired, and offers a complete range of validations and error messages distinct to each table and field. Validation is performed during a write to the table class property, or through a separate method in the table class. * A custom exception handler is supplied, and exceptions can be logged to event logs, files, a database table (which is built and inserted into the database), e-mail, or displayed in a message box. Any number of these logging methods can be specified simultaneously. * The logging functionality is provided in a static class which will be used for the exception handling, and, in addition, can be used to log anything else the user desires. * All the selections made during BoB.NET’s selection process are saved to an XML configuration file in the target project’s directory, and can be reloaded from there. * The initial release of BoB.NET requires that the database connection string exist in the settings. The user can specify that setting, and BoB.NET uses it for all database connections. The setting does not need the actual connection string for BoB.Net to produce its code. This functionality will probably be expanded in a later release * All the information and parameters necessary for proper operation in Visual Studio and SQL Server are available for user customization. These include the namespace name, stored procedure prefixes, etc. * All datetime fields retrieved from the database are converted to strings, and are used as strings throughout the generated code. These dates will be converted back to datetime for writing to the database. The default string format is selectable by the user. A customized nullable DateTime Picker control is provided to use these dates transparently. This allows the developer to have empty dates, as well as maintaining nulls in the database, all without intervention. * During development, if a change is required in the database, the user can merely re-build the single table or tables that have changed. BoB.NET will overwrite the classes in the project and drop and re-write the stored procedures (if chosen), all transparently. Business Tier * After the table level classes are produced, the user can then define and build the business objects themselves. These are produced by defining base table’s objects for the business object, and then defining associated table objects and the fields that related them to the base object. * Associated objects can be included that are either modifiable or read-only. * Load and save functions are included which provide read and write capability for the entire object, using the relationships defined during creation. * All business objects will be provided in two files, a BoB.NET controlled primary file, and a user file. These are built as partial classes, so the developer can add custom code into the user file, and be sure that his code will not be overwritten if the files are regenerated through BoB.NET. * Business object files will be written and included in a user-named directory in the project, and many ancilliary files will be built and provided in a user-named utility subdirectory. * The business objects produced by BoB.NET can be used as standard business objects, as UI objects that can be bound to a form, as objects that can be bound to a report, or any other use which could utilize a data object. Presentation Tier * Several UI elements are produced by BoB.NET in this initial version, and many more will be forthcoming in later versions. * As mentioned previously, a custom nullable DateTimePicker control is included, which will accept and output strings, and allow the user to have no date, or delete an existing date. * ComboBoxes, ListBoxes, and CheckedListBoxes can be produced with a user-defined query, a single-command initialize and load of the data, and a filterable Item list. A sub-classed control will be produced and added into the toolbox for each control desired. * Grouped checkboxes and radio buttons are also available using the same methodology. * TreeViews, ListViews, and DataGrids are also in development and testing, and will be available in a future version. |