ProgFest 2005 Platform
Project Report

Matthew Nelson

10 December 2004

1Abstract

For the past three years, CaliforniaStateUniversity, Los Angeles has sponsored a Programming Challenge called ProgFest to local community college and high school students. The competition wasorganized in part by a collection of online tools that managed registration information and the real-time communication between judges and teams. The system we propose in this report integrates these various services into a single, consistent web application built on J2EE technology. This new system reduces the possibility for human error in the judging process, normalizes the relational model, simplifies user navigation, and adds much-needed features.

2Introduction

The ProgFest Programming Challenge is an important opportunity for the Computer Science Department to encourage young high school and community college students to pursue future studies in computer science whileintroducing them to the resources available at CaliforniaStateUniversity, Los Angeles.The ProgFest Platform is an important component that helps the event to go smoothly and without interruption.

During the registration period, the system provides a registration front-end to community college and high school faculty and students. Various informational pages provide concise and accurate information to potential contestants.

To contestants, the system provides a front-end at theirrespectiveworkstations, displaying important real-time information regarding their team’sscore and rank in comparison to other teams. The display also provides tools for submitting problem solutions to the judges, posting public questions to be answered by the event organizers, and sharing files with teammates. Our solution improves upon the previous design by integrating all the tools into one consistent interface, with a single page that compiles only the most relevant and up-to-date information from each tool and displays it to the appropriate team. In the toolkit of past competitions, the submission interface looked remarkably different than the registration interface, which also bore little resemblance to the question and answer interface. The accompanying screen shots demonstrate this discrepancy and the new consistent design.

Figure 1 The inconsistent designs of the submission tool and
“FAQ Machine” question interface.

Figure 2 The new visual design of the ProgFest Platform.

The previous collection of online tools created a critical bottleneck in the judge’s room: the judges were notified of new submissions via e-mail messages sent to a single e-mail address. Throughout each competition, one person was forced to watch his e-mail inbox continuously, identify new problem submissions, and manually dispatch the problem to a specific judge. This was accomplished by writing the team name and problem number on a slip of paper and physically passing it to the appropriate judge. After assessing the submission, the judge would write a reply on the same slip of paper and pass it to a third individual responsible for manually entering the response into the system. Obviously, this design wasprone to human error. If a slip of paper was misplaced or any information was copied incorrectly, errors could be introduced into the scoring. The previous toolset was incapable of automatically correcting this or alerting the judges.

Our solution automates the process by eliminating e-mail notification and centralized data entry. Judges each log into our system, and the system itself automatically dispatches each submission to a judge’s respective screen. The system tracks the status of each submission internally, eliminating any dependence upon paper slips in the judge’s room. The judge interface also exposes a tool for responding to questions.

3Technological Background

The new ProgFest Platfrm is implemented with the latest in Java technology, utilizing various lightweight frameworks to increase quality and eliminate much of the tedious code prevalent in web applications.

3.1Java 2 Platform, Enterprise Edition

Java technology is designed around the need for secure, portable, and reliable network applications. It is both a programming language and an accompanying set of tools designed to standardize development and deployment of applications to any target platform. Java source code compiles into standardized byte code, which may be executed on any platform with a Java Virtual Machine implementation. The virtual machine both interprets the byte codes and, using the Java HotSpot compiler, translates them into instructions native to the underlying platform. [4]

Enterprise Edition is a superset of standard Java technology that adds tools and APIs for developing component-based multi-tier applications. [3] We utilizeEnterprise Edition technology exclusively in the web tier. Java Servlets are used for receiving HTTP requests and the resulting views are implemented in JSP.

3.2Jakarta Tomcat

The Jakarta Tomcat project maintains the official reference implementation of the Java Servlet and JSP specifications. We use Tomcat to develop and host our application.

3.3Hibernate

The Hibernate projectis designed to be a complete solution to the problem of persisting Java objects to relational databases, bridging the “paradigm mismatch” between SQL relational databases and object-oriented domain models. [2] In the object-oriented paradigm, domain objects may have subclasses, and are often decomposed into several finely-grained components. Relational databases often use coarsely-grained tables and offer no standardized mechanism for inheritance. Java applications interact with the domain model by navigating object references, invoking methods on each object. SQL, on the other hand, mandates that the application must retrieve all necessary information in each query. Hibernate elegantly eliminates these problems while performing faster than most other relational persistence methods. [1]

3.4Spring Framework

The Spring Framework seeks to simplify J2EE development by replacing specific layers of multi-tiered applications. Spring provides a flexible JavaBeans-based configuration management system that applies inversion-of-control design patterns. It offers abstraction layers for JDBC and transaction management and integration with object/relational mapping services like Hibernate. Finally, Spring includes aspect-oriented functionality and a flexible MVC web application framework. The project’s goal is to facilitate the development of business and data components that are not bound to specific J2EE services. [5]

4System Architecture

The new ProgFest web application uses the Spring Framework to manage application configuration and the MVC layer. The domain model is represented using simple Java objects, which may easily be persisted to a database using Hibernate or bound to web forms using Spring’s MVC framework. This eliminates the need for most of the tedious translation code often found in web applications. More specifically, Spring automatically binds submitted information to the object model, which Hibernate may then persist directly to the database. The view is rendered using JSP documents, and the entire application is hosted in a JSP/servlet container using Spring’s dispatcher servlet as the primary entry point.

5Design and Implementation Details

5.1GUI Design

The web interface is designed in a minimalist’s fashion to be simple and consistent. Each page features a consistent banner along the top with a sparse set of navigation links. The textual content beneath the banner is consistently formatted using CSS.

The site home page display a complete overview of the competition with links to any additional information, such as maps or data from previous competitions. The registration screen displays a list of teams and their associated schools, with links to register new teams during the registration period. On the day of the competition, a special login link on the home page links the contestants to a specialized My Team page. The page brings together up-to-date information from each of the different tools and displays it at-a-glance to the contestant. The page also provides links to screens for tools with more detailed information and to forms with which the user may submit new information to the system.

The administrator consoleand judge consoleislocated at a hidden URL. Each entry page prompts for a common judge or administrator password. Once logged in, the administrator may manipulate data in the system and make global configuration changes. The judges have a much more limited interface that permits them to respond to user submissions. After logging in, the judges may be prompted for a display name and display options. The system tracks the judge sessions and their associated names, facilitating the scheduling of problem submissions to judges and allowing the judges to reference each other by name.

5.2Request Work Flow

The ProgFest Platformis divided into three layers. From the perspective of a call-and-return model, each request enters the system at the uppermost presentation level and propagate deeper into the system. Each layer dictates how the response will be handled by the next.

5.2.1Presentation Tier

Figure 3 The major components of the presentation tier.

  1. The servlet container processes each incoming request. If the request is for some static resource, Tomcat responds by simply serving that resource. If the request instead maps to the Spring dispatcher, Tomcat invokes that servlet.
  2. The Spring dispatcherloadsand instantiates the application configuration on startup, including a set of controllers and interceptors. For each request, the dispatcher obtains the appropriate references from the Spring JavaBeans configuration, identifies the appropriate controller, and invokes the appropriate interceptors, controller, and view logic as defined in the configuration.
  3. The controllers perform any request processing, call into the business logic if necessary, and retrieve values to be displayed by a particular view. Upon completion, the controller returns the name of a view to the dispatcher.
  4. JSP views display the results of processing to the user with links to perform additional actions or retrieve additional information.

5.2.2Business Logic

Figure 4 Some of the more frequently used objects in the business layer.

The application’s business logic is implemented in the usual Java object-oriented paradigm using plain Java objects and regular references, properties, and methods. The implementation is completely unaware of and decoupled from the adjacent presentation tier and persistence code.

To keep the presentation layer completely decoupled from the persistence layer, the business layer also contains simple data access object interfaces that supports simple insert, select, update, and delete operations on data objects.

5.2.3Persistence Layer

Figure 5 The major components of the persistence layer.

  1. Spring Transaction Proxy classes are generated by a factory class in the Spring framework and wraps our data access object implementation. These proxies automatically start a new transaction, bind it to the thread, and commit it after the data access code successful completes.
  2. The data access objects are responsible for querying Hibernate for persisted objects as requested by the controllers. The specific implementation we developed takes advantage of Spring-provided Hibernate Templates. These convenience classes translate proprietary Hibernate exceptions to standardized Spring exceptions and automatically participate in Spring-managed transactions. [5] The views never invoke the data access objects directly, but may indirectly query Hibernate through the use of proxy classes and lazy loading.
  3. Hibernateis responsible for managing the mapping of data objects to a relational database. On application startup, Hibernate reads a series of Hibernate Mapping files and pre-compiles the SQL statements.

5.3Database Backend

The flexibility afforded by Hibernate will permit us to choose almost any database backend. The ProgFest application should be portable to any database management system supported by Hibernate. We the developers have chosen to use PostgreSQL to take advantage of its rich feature set and strong referential integrity checks.

6Conclusion and Future Work

We look forward to observing the impact of this project on the upcoming ProgFest 2005 competition and receiving feedback from participants. We plan to explore the possibility of implementing any significant suggestions that improve the platform for future competitions.

7References

[1]Bauer, Christian and Gavin King. Hibernate in Action.Greenwich: Manning P, 2005.

[2]Hibernate. 17 November 2004. <

[3]Java 2 Platform, Enterprise Edition (J2EE). Sun Microsystems. 17 November 2004. <

[4]Java Technology Overview. Sun Microsystems. 17 November 2004. <

[5]Spring Framework. 17 November 2004. <

1