Leanne Isaac and Dr. Phillip J. Windley, Computer Science
As Java, a new language developed for the Internet, has continued to grow in popularity, the face of the World Wide Web is changing. Now, once static HTML pages are lined with moving animation and sounds. While the possibilities that Java brings to the Internet are practically endless, creating these applications is not a simple task for the everyday Internet user who has not had experience in advance computer programming. With this fact in mind, I thought that if it were possible to create a simple and direct language that could be sent to a program which translated it into the equivalent Java code, the benefits of Java could be available to more Internet users.
Java is an object-oriented language, meaning, it is based primarily on data that is associated with functions which use that data. For example, a package called shapes may be created to contain many classes such as “circle”, “square”, “triangle”, “rectangle”, etc. A “square” class may contain information on the length of its side, and a method that would draw a square of that size to the computer screen. In order to create a class called “house”, instances of the “square” and “triangle”classes would be used instead of rewriting the already existing code. An object oriented language has many benefits because methods created by other people can be reused and extended to create other objects. The Java Language offers many packages of classes that can be very useful in coding.
After studying and working with several different parts of the language, I chose to narrow the focus of the project to Java’s AWT library (Another Windows Toolkit). I chose this part of the language because I felt that it would provide more possibilities for use on the Internet because it includes items such as windows, buttons, menus, cheekbones, and choice lists.
After creating an apple that displayed a number of these window objects using the Java language directly, I created a basic abstraction of the Java code. This abstraction was used to define syntax for the Cocoa Language. This syntax consists of simple statements that include the type of object that is to be displayed along with an identifying name supplied by the user. Using this new syntax, I developed a Cocoa program to create the same application that the Java program created. I then wrote a translator in Java that would take the Cocoa program and use its information to generate the equivalent Java code.
Overall, I feel like the project was successful, and I learned a lot about the Java language. However, at this time I do not think that a complete abstraction of the Java language would always be helpful. The language is so complex that there is really no way of setting around the difficulties of programming Java applications. Even when a translator such as the Cocoa translator is used, the user is still required to have a solid knowledge of Java in order to create a complete and working application. A general overview of the translation process from the Cocoa Language to the Java Language intricacy of a program, comes the increasing complexity of the source code. As the programmer gets into issues such as “what will the program do when the user clicks on the ‘OK’button”, there are numerous possibilities that arise and the programmer needs to understand the language well enough to be able to write a program that will perform in the way that he/she envisions. Because of the almost endless number of ways a user may want his/her program to run, creating an abstract language that would capture all of these possibilities would be difficult. The simpler language may also require just as much knowledge of the user as writing the same program in Java. Creating an abstract language that simplifies the programming for the user is possible, and perhaps with time more methods may be developed that will continue to help make the benefits of Java easier for all Internet users to enjoy.
References
- Tim Ritchey, Programming with Java! Beta 2.0, New Riders Publishing: Indianapolis, Indiana(1995).
- Java Language Hompage, “http://java.sun.com/”
- Java Language API, “http://java.sun.com/ products/JDK/CurrentRelease/api/