Commercial Database Software Development- A review. A database software has wide applications. A database software is used in almost all the organizations. Over 15 years many tools have been developed for creating database applications. Many have lost out in the race and some, mostly those from the large software firms have remained in the race. Of these, the popular ones are Visual Basic, Developer 2000 from Oracle, Delphi from Inprise. The earlier popular ones are Clipper, dbase, and Access. If you need to decide which tool to select for your database software keep in mind the following aspects: a. Support and upgradation of the tool is a must. b. In-built database functions are essential to develop database software. As a consequence of the potential, there are plenty of job opportunities in Database software market. With the advent of the internet, web based database application development is also driving the job market. We will, in this article, discuss database software development, which will give you an idea of how applications can be developed using VB and SQL Server. A database software can be developed for domains like: a. Accounting b. Inventory c. ERP d. Healthcare e. Manufacturing f. HR and many other domains. Whichever domain you choose, the basic principles and techniques remain the same. We will see the typical structure of a database software.
Structure of a Database Software. Masters Transactions Reports SQL Server 2000 Stored Procedures Triggers Presentation Layer Business Layer Data Layer Visual Basic ADO & VB Stored Procedures - SQL We will now discuss the salient features of a good database application. The first requirement of a good database application is the from the developers perspective. The team, which is developing the application should have a good knowledge of the working of the domain. The developers should know all the various intricacies, practical issues, which are important for conducting business in a particular domain. The next issue is the basic design of the software. The software should be based on Object Oriented Design. This design aspect, if applied to the user interface results in a minimum number of forms to be deployed for the entire application. For instance, in an inventory application, a single form can be created, and using inheritance, all the other forms can be created at runtime. An object-oriented approach will go a long way in ensuring the success of project. As we all know, many database software are deployed on a network. This is possible if the database application is developed for a client server network. An application with server side programming will turn out to be a good and reliable client server product.
The following issues and steps are common in developing a database software. They are listed below: a. Client Server Issues b. Stored Procedures c. Developing the Standard Modules d. Designing the database using SQL server / any RDBMS e. Transactions f. Application Interface A. Client Server Issues To setup a network for development, we should know what are the components of a network, the topology and technology being used. Firstly, the OS has to be installed keeping in mind the purpose for which the application is being developed and deployed. The next step is to decide the model to be used. A tip here is to choose Domain model if more users and sophistication on central administration is required and the Workgroup model if less number of users are going to use the application. For the domain model we need to install the DNS server. B. Stored procedures A stored procedure is a routine written in T-SQL by using the DML, which acts on rows of a table in a database. SQL does not support IF statements and functions which manipulate strings, formatting functions, whereas T-SQL supports all of them. Stored procedures are stored in SQL Server databases. We can use stored procedures to build business rules into the database. After stored procedures have been stored to the database, users and applications can call them as if they were another SQL statement or a built-in T-SQL function. The main advantage of using stored procedures is performance. Stored procedures execute on the database server, close to the data. Stored procedures, which are nothing but data manipulation code, execute faster than passing SQL statements from VB. A stored procedure can scan thousands of records, perform calculations, and return a single number to an application. All calculations occur on the database server and data is not moved across the network. For this reason stored procedures are faster than equivalent SQL statements. After stored procedures are defined, they become part of the database and appear as database objects, like tables or views. This makes it easier to access the stored procedure statements and manipulate them. Once they are tested, stored procedures do not require compiling as is the case with VB code. We can set security on the stored procedure so that only callers with appropriate permissions can execute the logic. Using stored procedures we can encapsulate the business logic, hiding database structure changes from an application. We can also change the structure of the underlying tables, by modifying the stored procedure without affecting applications that use the stored procedure. By providing a stored procedure for editing the transactions, we can ensure the integrity of the data. Stored procedures are used to query data into the database, save data into the database, and update multiple tables.
We can use the SQL Server Query Analyzer or the Enterprise Manager to write, debug, and execute stored procedures against a database. To create a stored procedure, we enter the definition of the procedure into the database. We create a new stored procedure by using the CREATE PROCEDURE statement and save it to the database. This step does not actually execute the stored procedure. To execute a procedure saved into the database, we must use the EXECUTE statement. C. Developing the Standard Modules The next step is to develop the standard modules. Standard modules are sections of the code, which you will access repeatedly across the application. Declaration of Constants and chosen procedures and functions are written here. D. Designing the database using SQL server / any RDBMS Database design is one aspect of the application development where domain expertise matters most. It is important to remember that once a database design is arrived at for a particular set of specifications, it is difficult to change or alter the design, frequently. So, better do a lot of reviews to arrive at the final working design. ADO is commonly used to access the SQL Server database. ADO is mainly used to: Open a connection Close a connection Retrieve data from the server Save data All the above can be implemented in an elegant way by writing a class. Developing a class is a technique, which is a topic by itself and can be got from the book. E. Transactions While databases can efficiently hold large amounts of information that can be queried, all that data and all that querying power is useless if the data is incorrect or nonsensical. Databases provide a plethora of techniques for ensuring the integrity and consistency: primary key and unique constraints can be employed to ensure entity integrity; foreign key constraints aid in ensuring relational integrity, and transactions help ensure that the database's data remains consistent.
While INSERT, UPDATE, and DELETE statements are the most granular operations for modifying a database's underlying data, at times we want to treat multiple INSERT, UPDATE, and/or DELETE statements as one atomic operation. That is, in certain situations, rather than having each INSERT, UPDATE, and DELETE statement stand on its own, we want the set of statements to be, together, an indivisible unit. When issuing this set of statements we want either the entire set of statements to succeed, or all to fail - there should be no 'in-between' state. The canonical transactional example is transferring money from one account to another. A money transfer account at a bank requires two steps; if we want to transfer $500 from our checking account to our savings account, the following steps must be processed: First, $500 must be deducted from our checking account, Next, $500 must be added to the savings account In terms of SQL syntax, this would involve two UPDATE statements - one subtracting $500 from the balance of the checking account and the other incrementing the savings account balance by $500. It is vital, however, that these two steps are treated as one atomic unit. What we want to avoid is to have step 1 complete, subtracting $500 from our checking account, but before step 2 can run, crediting our savings account, imagine that the database server crashes. (Well, this scenario is something the bank might not get too upset over!) It is important that either both of these steps complete in total or neither complete. Database transactions are what ensure atomicity, one of the key features of any database system. Microsoft SQL Server, as well as any professional grade database product, has support for transactions. In this article we'll examine how to wrap multiple SQL statements within an atomic database transaction using the SqlTransaction class in the System.Data.SqlClient namespace. A Database transaction is a series of statements that either succeed or fail as a whole. In a journal voucher transaction, user enters two accounts creditor account and purchase account. Creditor account Credit $1000(-) Purchase account Debit $1000 (+) We should update both the accounts.if one of the following accounts updation fails, it would be better if both statements fail.microsoft SQL Server itself supports transactions through the BEGIN TRANSACTION, COMMIT TRANSACTION, and ROLLBACK TRANSACTION statements. F. Application Interface As the developer you have to create a menu, which will include access to open all the forms you plan to design. When you start with programming entries, you will start seeing the application taking shape. Validations can broadly be divided into two categories. Validations in the front end and those set up on the server side. The server side validations are implemented using stored procedures. The next step is to write the reports. Firstly, you will have to decide on output format. Depending on the format, write the correct SELECT statements (Query Statements). Use the indexes properly to increase the performance of the report generation.
Conclusion: This article is intended to give you a brief idea of the issues related to application development for a client server environment. I hope that it has given you a basic idea of the issues involved. If you have any questions you can always refer the book which does an excellent job of explaining the steps to develop the application in detail.