XTech 2006 news

Newsletter sign-up


RSS and Atom feed icon News feeds

The Viper Solution: A Data Persistence Model using XML and PHP

Applications Grand Ballroom

Recently, web frameworks, such as Ruby on Rails, have been developed to make web development easier. Much of the “scaffolding code” for the most common type of web applications is created automatically so that the web developer need not concentrate on the often tedious and repetitive configuration tasks. Rather, the developer can devote his/her energies to more interesting tasks, such as domain-specific logic and application behavior.

One important piece of these frameworks is the persistence model used to simplify and abstract database access. This follows the same philosophy: leave the details of database access and manipulation to the framework so that the developer can concentrate on the behavior of the data. Many persistence and object-relational models exist, including Ruby Rails’ own Active Record, JBoss’ Hibernate, and Enterprise Java Beans. We propose a simple persistence model in PHP using IBM’s upcoming release of Viper with its native XML support.

PHP is a popular scripting language that is suited for web development. It is not only easy to learn, but can be quickly used for developing sophisticated applications. Our proposed model, tentatively called Data Access Service (DAS), abstracts all database Create, Read, Update, and Delete (CRUD) operations. Furthermore, by using XML as the underlying storage structure, the developer need not know anything about the underlying table schema. The schema “automatically” evolves as the developer’s needs evolve.

All this is made possible by using Viper’s XML capabilities. Viper uses a native XML data type and provides a means to represent, access, analyze, and integrate data and content across heterogeneous information sources. This inherently allows the data management and interchange that web development requires. Viper provides a powerful XQuery engine and standardized SQL/XML publishing functions leading to the use of “XML-on-the-edge” technology. This use of XML functionality, abstracted by the DAS and without inherent knowledge of how Viper uses the data store, is a viable option for those new to web applications and XML, but familiar with basic programming techniques. Still, for the more sophisticated programmer who is familiar with standard SQL and data access methods, it is hard to ignore the added value the DB2 engine provides as an enterprise database management system.

This paper will focus on the DAS, a data access and persistence XML model and API that allows programmers to develop simple web applications that require a database. A simple example will demonstrate how Viper allows for faster and more intuitive PHP application development and maintenance. Finally, best practices and methodologies will be identified and described for the most common type of data-centric web applications using Viper and PHP.

Chair: Michael Kay