
Separation of Design and Function
February 10th, 2006Although Java provides a very thorough and straight-forward library for creating Graphical User Interfaces (GUIs), this task is always quite cumbersome. The design is often not too hard to create originally but if there ever needs to be anything added, removed, or modified, the code can get pretty messy. This problem arises because Java requires that you program a design, instead of describe it. The most often created graphical user interface is a webpage, and this is because they are so easy to create. The design of a webpage is not programmed, but described using a markup language such as HTML or CSS. This technique makes it much easier to build and maintain complex designs, but it does have limitations. Making applications in Java (and in general) requires a deep level of interaction and customization that HTML or CSS could never supply. Markup languages are used to display data, but Java applications are used to manipulate data, and this presents a problem. There must be, however, some way to abstract the design of a GUI to a higher level. Even a simple GUI in Java requires the instantiation of over a hundred objects, and this is not acceptable. I have seen WYSIWYG tools that will generate Java code from a drag ‘n drop design canvas, but I have never liked working with tools such as these. Ever since I started creating webpages, I have always preferred working with the text, not a design editor. One idea would be to integrate XML more closely with Java and use style sheets and transform files to describe the design, but I don’t envision this happening anytime soon. Maybe I’m just complaining unnecessarily, but I have never enjoyed programming GUIs in Java or any other language and I think something needs to be done to separate design and function. Programming languages are meant to do things, not describe things. That’s what’s great about creating web applications – you can use the language of your choice to provide the functionality and then generate simple HTML or CSS to display the output in a complex way.
(This is post number two for my Advanced Java class)
