One of the most tedious parts of developing database-driven applications is coding the classes for your database objects. Especially in a situation when you are dealing with a database containing a large number of tables, or tables with many columns. Today, the application development process has vastly expanded so it is better to use sub applications to generate code dynamically / automatically. I developed this application to reduce burden on software developers and provide them some relief. As a software developer, I can understand very well that programming is a tough job so they need some rest.
The application is designed to create:
- Business Logic Layer class
- Data Access Layer class
- SQL Database Stored Procedure script
- Reduce development time.
- Reduce development cost.
- Follow standard coding techniques and application architecture.
- Fully commented code so any one can easily modify it according to their needs.
How to use this application
In order to use this application, you must know the computer name/ IP address and the login information for connecting to a SQL Server database.
After successful login, you can go to another tab "Create Class and Stored Procedure". Select a particular database and check the tables to create the Stored Procedure and classes. Click on the Create button to create Stored Procedures and classes.
All classes and Stored Procedure scripts reside in the bin folder.
As a very simple example, suppose we have the table name Employee.
Create Business Logic Layer class
The Business Logic Layer class contains the namespaces, default constructor, private fields, and public properties with getters and setters and all the methods (Select, Insert, Delete, and Update) required for connecting the Database Access Layer. For every database table, it creates a class with the same name as the table name and concatenates it with controller. This example application will create a class with the name
clsEmployeeController. It also creates properties with the name same as the table attributes.
Create Data Access Layer class
The Database Access Layer class contains the namespaces, default constructor, private fields, and public properties with getters and setters and all the methods (Select, Insert, Delete, and Update) required to directly deal with a database with Stored Procedures. For every database table, it creates a class with the same name as the table name and creates the properties with the same name as the table attributes. In this example, the application will create a class with the name
Create Stored Procedure script
It also creates a script of four Stored Procedures (Select, Insert, Delete, Update) in a Notepad file with the same name as the table name. You can simply copy and run it on the SQL Query Analyzer.
Points of Interest
I did not use any library in this application. It is a small application with big benefits.