next up previous
Next: A Brief Introduction Up: DJ : A Previous: DJ : A

Introduction

The World Wide Web has become a great vehicle for disseminating various kinds of documents. Web documents used to be static and to contain only text, but now many Web documents are dynamic, and contain not only text but also image, video, audio, graphics and animation. Java is a powerful language for programming interactive, dynamic, and content-rich Web documents as Java applets. Nevertheless, developing GUIs including applets in Java is a time-consuming process. The users have to, among other things, choose appropriate layout managers and sometimes have to determine the sizes and positions of graphic components. There are many visual tools, such as Java StudioTM, for creating Java programs without the need to write any code. These tools require the users to build GUIs by using mouses. However, it is difficult to manipulate components with satisfactory accuracy when the number of components becomes large and the constraints on the layout become complicated.

DJ is a language that amalgamates Java and Constraint Programming. DJ, as an extension of Java, significantly simplifies the process of constructing GUIs and Java applets. The users only need to specify the components that compose a GUI and the relationships among the components by using constraints. The layout for the components is automatically determined by the system. As a constraint programming language, DJ improves the current constraint languages in that problems and solutions can be described in the same language. And most importantly, since DJ is a compiling language that uses Java as the object language, results can be distributed on the World Wide Web as Java applets and/or included in other larger applications.

A compiler for DJ has been implemented in B-Prolog [8], a constraint logic programming system. For a DJ program, the compiler first extracts a constraint satisfaction problem (CSP) from the program, and then invokes the constraint solver to solve the problem and determines the attribute values for the components. It finally generates a Java program and an HTML file from the original DJ program and the solution obtained by the constraint solver.



next up previous
Next: A Brief Introduction Up: DJ : A Previous: DJ : A



www-admin@icot.or.jp