Developing a Three Tier Web Application Using ASP.NET and Open Source Object-Oriented Database DB4Objects Morris M. Liaw Ph. D. liaw@uhcl.edu Venkata Durbhakula dvijaykrishna@gmail.com Mahesh Molakalapalli molakal9@gmail.com Abstract This paper details the use of DB4Objects object-oriented database and ASP.NET 3.5, MVC architecture and the Visual Studio IDE (Integrated Development Environment) to develop a three tier Web application. The major contribution of this paper is to show how a three tier web application can be easily developed and deployed by taking advantage of an object-oriented database instead of using ADO.NET or Datasets that access traditional relational databases. A sample web application called Fee Management Tool is developed to illustrate DB4Objects as the backend of the web application and the Visual Studio 2008 IDE can be used to run the DB4Objects plug-in. Future directions and implications are discussed at the end of the paper. Keywords Object-Oriented Database, ASP.NET, DB4Objects, Visual Studio, Web Application Introduction For developing a web application the essential tools are Integrated Development Environment (IDE) and Application Programming Interface (API). API libraries are used in abstracting common programming tasks (making database connections) required in developing a web application. In this paper, we show how Microsoft s Visual Studio IDE can be used to develop a three tier web application that uses DB4O for the backend database and use of C#.NET classes to abstract communication with backend database. The paper includes discussion about connecting to DB4O, writing and retrieving data, and configuring Microsoft Visual Studio to run DB4O toolkit. Visual Studio is an integrated development environment (IDE) for.net environment and is developed by Microsoft [1]. It has a capability to install different kinds of plug-in into its environment. DB4O toolkit called Object Manager Enterprise (OME) can be installed into this Visual Studio to for browsing classes and back end database objects. Visual Studio supports graphical user interface applications, Windows applications, and many
other applications. It has an integrated server called the Internet Information Services (IIS) running on it to run and build the applications. Visual Studio supports development of web applications in both C#.NET, VB.NET and the latest F#. For this study, we develop our project using C#.NET. DB4O is an open source object database management system designed by Versant Corporation [2] for.net and Java developers. DB4O has a strong feature of One-lineof code database where a single command is used to store an entire object into database. For example, a single store can alone insert a single record without any additional statements. Along with this, there are many other features like dynamic scheme evolution, native queries and LINQ etc. To illustrate the use of DB4O, we develop a web approach for an existing manual system in this paper. Fee Management Tool is an online web application developed for schools and college to manage their fee processing. This project uses Microsoft Visual Studio to facilitate the building and deploying application on to server. Visual Studio is also configured with OME to run DB4O. In this application the client and server classes were eliminated so as the application connects directly to database which is a more portable solution. A web application was partially implemented using this approach. Preliminaries Most of the existing systems are developed with backend as relational database. Though relation databases especially the Oracle is ruling the market, there are quite good reasons to select Db40, Object oriented database as a backend. In some aspects object databases are much better than relational databases. The reason to select the db40 is that it is a fully featured database. Db4o can be embedded into devices like mobile phone and personal computers. Database administration play key role in most of the relational databases. The advantage with the DB4o is that any kind of special administration is not required. It can also simplify the refactoring in dataware applications. Most of the object-databases especially Db4O can efficiently work in different platforms. This db4o is available for.net, Java, and Mono. [3] Fee management tool is a comprehensive web based system that helps institutions and schools to manage funds. The fee management tool handles all the key fee management functions, including student information, handling of funds by the students, administration, management and students relations management. Fee management is a system to alleviate financial losses for the institutions by reducing risk of loss. The aim of this system is to develop an online system for an institution or school. Generally an institution manages funds collected from the students for the suture use and management of the students. There will be an accountant for this institution who manages the information about fee collected from the students. The figures below show the sample screen shot s of the system. Figure 1 shows the Home page of the Fee Management Tool and Figure 2 is the Add Student page, which is used by the administrators to enter the details of the new student. A sample flow chart of the project is depicted in Figure 3. The online project is available at
http://sce.uhcl.edu/db4o/main.aspx. Figure 1: Home page of the System Figure 2: Add Student page Figure 3: Flow-Chart showing actions available in the System
Using DB4O DB40 is an object oriented database language that can be used for storing/retrieving objects in database with simple commands. Commands like SET, STORE, and GET make the task of database transactions easy when compared with the traditional relational databases [4]. These commands are under the namespace of DB4Objects.DB4O To insert an object into database we use simple STORE command with parameter as the required object. Following is the syntax for inserting a Student object into database using STORE command. db.store(studentobject); To retreive an object from database we use simple GET command with parameter as the required object. Following is the syntax for retreiveing a Fee object from database using GET command. The result from the GET command is stored in the IObjectSet for being able to fetch to table. Fee feeobject = new Fee(); IObjectSet reslut = db.get(feeobject); To update the objects, the object need to be retrived and then we make the required changes. Aftert that by calling the db.set(), the object can be updated. db.set(studentobject); db.close ( ) command is used to close the object container. db.close ( ) makes all database operations to be written to the database before closing the database. db.close(); db.delete () is used to delete the retrieved object. As was the case for updating, the database has to know what object, we want to delete, so the object to be deleted either has to be set or more likely retrieved with in the same transaction. db.delete(studentobject);
Concerns on the DB4O There are some concerns on Db40. If the older system is already relational based then replacement with object databases is not compatible. Db4o cannot support database clustering. Data ware house, data mining, tuning and reporting tools that support object databases are not yet designed. Transaction management and recovery is not good compare to relational databases. [3] Conclusion The development of the Fee Management Tool application shows that the Microsoft Visual Studio IDE can be used to develop standard, portable Web applications that take advantage of an object-oriented database. We further show that communication with a database such as DB4O can be accomplished using.net classes instead of routine libraries to access traditional relational databases. Future studies can try to explore the deep potentials that object-oriented databases has, especially with DB4O. References [1] http:// www.microsoft.com [2] http://www.versant.com [3] J. Paterson, S. Edlich, H. Horning and R. Horning, The definitive Guide to db4o, Apress, 2006. [4] M. Norrie, M. Grossniklaus, C. Decurtins, A. de Spindler, A.Vancea and S.Leone, Semantic Data Management for db4o, Proceedings of ICOODB, 2008.