Xml in the User Interface Context




НазваниеXml in the User Interface Context
Дата03.10.2012
Размер0.51 Mb.
ТипДокументы

XML in the User Interface Context


Abstract


The purpose of this thesis is to investigate to what extent XML (Extensible Markup Language) based languages are suitable for use as user interface definition languages in terms of their flexibility. The primary method used is qualitative analysis of scientific papers, literary resources on the target field, practical experiences as well as certain essential non-scientific literature such as standards documents and more practically oriented reference literature as well as on-line resources. XML has been shown to support international characters, the separation of user interface and logic as well as cross platform development very well. The derivative standards utilize these fundamental characteristics of XML in this context and add their own contribution to the mix. Our conclusion is that XML as such is ideally suited for creating flexible user interface definition languages. By flexible we mean that they exhibit some degree of all the flexibility factors reusability, customizability and localizability. The particular XML based languages we have looked at, namely XUL (XML-based User Interface Language) and UIML (User Interface Markup Language) have also been found to add varying degrees of extra weight to the flexibility factors already found in XML. The findings indicate for example that the levels of abstraction in a particular derived language greatly affect the level of additional flexibility achieved through the use of the language in question.


Contents


1 Introduction......................................................................................................... 1

1.1 Problems & Possible Solutions........................................................................ 1

1.1.1 Reuse............................................................................................................ 1

1.1.2 Customization............................................................................................... 1

1.1.3 Localization................................................................................................... 2

1.2 Previous Research............................................................................................ 2

1.3 Main Objectives............................................................................................... 3

1.4 Questions to Answer........................................................................................ 3

1.5 Hypothesis........................................................................................................ 3

1.6 Hypothesis Visualization................................................................................. 4

1.7 Variable Definitions......................................................................................... 4

1.7.1 Independent............................................................................................................ 4

1.7.2 Dependent.............................................................................................................. 4

1.8 Delimitations.................................................................................................... 4

1.9 Target Audience............................................................................................... 5

2 Methods................................................................................................................ 6

2.1 Literature Study .............................................................................................. 6

2.2 Case Study....................................................................................................... 7

2.3 Practical Examples........................................................................................... 7

2.4 Shared Criteria................................................................................................. 8

3 Subject Overview................................................................................................ 9

3.1 XML................................................................................................................. 9

3.1.1 Introduction............................................................................................................ 9

3.1.2 Textual Data........................................................................................................... 9

3.1.3 Comparing XML to HTML................................................................................... 10

3.1.4 DTD’s.................................................................................................................... 11

3.2 UIML............................................................................................................... 12

3.2.1 Introduction............................................................................................................ 12

3.2.2 Document Structure............................................................................................... 12

3.2.3 A Basic UIML Document...................................................................................... 12

3.2.4 The UIML Elements.............................................................................................. 13

3.3 XUL................................................................................................................. 15

3.3.1 Introduction............. .............................................................................................. 15

3.3.2 Structure................................................................................................................. 15

3.3.3 Style Sheets & Scripting........................................................................................ 16

3.3.4 DTD’s.................................................................................................................... 16

3.3.5 Basic Example....................................................................................................... 16

4 Impact of XML on the Mozilla Web-browser - A Case Study........................ 18

4.1 Brief History.................................................................................................... 18

4.2 Project Structure.............................................................................................. 18

4.3 The use of XUL............................................................................................... 19

4.4 General Observations....................................................................................... 22

4.4.1 Stability Issues....................................................................................................... 22

5 XML Based User Interfaces - A Practical Point of View................................ 23

5.1 Application 1 (UIML)...................................................................................... 23

5.1.1 Implementation...................................................................................................... 23

5.1.2 Renderings & Observations................................................................................... 26

5.2 Application 2 (XUL)........................................................................................ 28

5.2.1 Implementation...................................................................................................... 29

5.2.2 Renderings & Observations................................................................................... 32

6 Result.................................................................................................................... 34

6.1 Reusability....................................................................................................... 34

6.2 Customizability................................................................................................ 36

6.3 Localizability................................................................................................... 37

6.4 Summary.......................................................................................................... 37

6.5 Conclusion....................................................................................................... 38

7 Discussion............................................................................................................ 39

7.1 Literary and Scientific Resources.................................................................... 39

7.2 Case Study....................................................................................................... 39

7.3 Practical Examples........................................................................................... 39

7.4 Summary.......................................................................................................... 40

8 References............................................................................................................ 41

8.1 Literature.......................................................................................................... 41

8.2 Other Sources................................................................................................... 41

9 Tables, Plates and Listings................................................................................. 43

9.1 Tables............................................................................................................... 43

9.2 Plates................................................................................................................ 43

9.3 Listings............................................................................................................. 43


Appendices


Appendix 1 - Table of UIML Elements
Appendix 2 - Table of XPToolkit widgets



Appendix 3 - Source Code Listings



Appendix 4 - Terms and Concepts1 Introduction


The use of XML is an exiting new field, which is still pretty much in its infancy. XML seems to have the potential to become the first truly widespread universal language for data exchange. This exchange is not limited to the traditional areas such as EDI and publishing but may be extended to all areas where a universal hierarchical data structure is needed such as for defining the structure of a user interface. The popularity of XML is to some extent linked to the popular object oriented programming paradigm. This is due to the similarities between an object structure and the hierarchical structure possible in XML. These similarities have already manifested themselves in the rise of standards such as the Document Object Model, which serves as glue that binds conventional object oriented languages to hierarchical markup languages.


1.1 Problems & Possible Solutions


There has traditionally been an unclear distinction between user interface design and software development in general. User interfaces has in the past and still are mostly developed by programmers in the same language used for the rest of the system. The paradigm of object orientation simplified the creation of user interfaces because user interface entities can to some extent be viewed as objects. One big unsolved problem however is that the procedural languages as well as indeed the object oriented are still far to rigid and inflexible for something as changeable as a user interface (or at least, in some cases, something that should be changeable). User interface metaphors change, new trends come and go, new operating systems and platform are created and falls into obscurity. This has led to a constant rewrite of user interfaces, many of which could conceivably have been reused. Granted that the basic idea behind a user interface can be reused, the actual code however often has to be rewritten from scratch. Other flexibility problems are related to the fact that humans are different, we come from different countries and cultures we have varying levels of education and we have different preferences. These flexibility problems can be summarized into three keywords: reusability, customizability and localizability.


1.1.1 Reuse


Separating the user interface from the application logic would allow user interfaces to be reused when the application itself is moved from one development environment to another, saving a great deal of money and time for the company developing it. It would also allow for a cross platform user interface to be designed independently for use on several platforms. Hence, developing cross platform applications will benefit from this de-coupling of user interface and logic because you don't have to develop several platform specific user interfaces from the ground up. A human readable text based definition language without the need for compilation would also simplify reuse as plain text can be easily copied without having to revert to any source code state.


1.1.2 Customization


Customizing a de-coupled interface is also made easier by the fact that the interface can be updated without making any changes to the rest of the application. A problem with more traditional methods is that it is generally the programmer who gets to perform the actual coding of a user interface, even though someone else might originally have conceptualized and designed it. A designer wanting to make a change to the user interface, even a minor one would always have to go through the programmer to get things done.


A great deal of worth can also be added to the product by allowing third party developers or the public to make changes to the interface, this has been tried before and has in some cases had the effect of greatly popularizing the product in question. An example of such an application would be the popular music player WinAmp from Nullsoft.


1.1.3 Localization


Translating applications and ultimately their user interfaces traditionally required the replacement of every string of text in an application, which might have thousands. These strings were often interspersed throughout the entire source code making it extremely difficult to locate and translate them all. This is where the concept of centralization comes in. Centralizing all language specific text in a user interface to one or a few sources greatly simplifies the process of translation. Translating textual materials from one character set to another has also been a problem, the Chinese scripts for example have far to many ideographs for them to fit into the same space as the limited ASCII character set. This led to the creation of character sets like Unicode. Unicode is capable of representing thousands, even millions of characters from all over the world.


1.2 Previous Research


There are a number of areas of computer science research relevant to our thesis. These include human computer interaction (HCI); life cycle theories and models as well as the object oriented paradigm. We have also read a great deal of reference literature on the subjects of XML, UIML2, XUL, HTML and the Unicode standard to name a few. We decided to look into literature on the object orientation paradigm because it is these types of languages, most likely to be used in conjunction with the present and potential future XML based user interface languages. Another reason is that XML as a language is hierarchical in nature and resembles the hierarchical nature of the object model.


One of the reasons for writing this thesis is of course that we feel that the currently available literature doesn't answer our questions properly. There are a few examples of papers and online articles written on the use of XML in the user interface but they are either biased or overly informal. Examples would be UIML2: An Appliance-Independent XML User Interface Language (see Abrams [9]) by the researchers behind UIML and the various tutorials and reference materials available for XUL such as Neil Deakins excellent XUL tutorial and XUL reference (see Deakin [15] and [16]) as well as the Mozilla.org XUL resources.


The flexibility factors, which are so central to this thesis, have theoretical foundations from many different sources. For reusability we have references in Phanouriou [22 p. 86] and Berard [1 p. 339]. We have references to customizability in Phanouriou [22 p. 54, 132] and from Harmonia (formerly Universal Interface Technologies) [27 p. 1]. References to localizability are found in Phanouriou [22 p. 149] and Cheng [12]. The word flexibility as a collective term for these factors was not found in any literature although we base our decision to use it on the suitability of the word itself. The entry on Merriam-Webster’s on-line collegiate dictionary (www.m-w.com) for the word flexible states that it can be defined as, and we quote "3: characterized by a ready capability to adapt to new, different, or changing requirements". Put this in contrast with the definition of the otherwise used term "dynamic" found in for example Phanouriou [22] and Harmonia [27] which is stated in the same dictionary as meaning "2 a : marked by usually continuous and productive activity or change b : ENERGETIC, FORCEFUL ". We feel that the former definition, the one for flexible, is better suited to describe the factors of reusability, customizability and localizability.


1.3 Main Objectives


We want to look at to what extent XML is suited as a structural language for user interface definition and how well it will serve to de-couple the user interface from application logic and platform specific issues. To reach clarity on this issue we have decided to look at how the use of XML for the implementation of user interfaces affects a number of flexibility factors. These factors are Reusability, Customizability and Localizability


1.4 Questions to Answer


  • Does the use of XML as a markup language for defining user interfaces lead to more reusable, user interfaces in comparison to traditional, more rigid, technologies? Will the use of XML improve customizability and might it also make user interfaces more localizable?




  • To what extent are the current XML based user interface definition languages such as UIML and XUL "extensible" in view of potential future and present user interface technologies based on for example virtual reality and speech synthesis/recognition? How extensible is XML itself in view of the same future technologies?




  • Which are the potential benefits of abstract markup versus specific markup?




  • Are XML and derivatives thereof likely to be the formats of choice for the user interface designer of the future?


1.5 Hypothesis


The use of formats based on XML, as languages for the implementation of user interface architectures will result in flexible user interface architectures.


The term "implementation" means the definition of, or the actual code used to describe the user interface. The term "architecture" in this context means the underlying structure of the user interface. The term "flexible" can be subdivided into the component variables: reusability, customizability and localizability.


1.6 Hypothesis Visualization





Plate 1: Visualization of hypothesis.


1.7 Variable Definitions


1.7.1 Independent


  • The XML-based User Interface Language (XUL) is a language based on XML (see Hunter [5]), which is being used for defining the user interface of the Mozilla and Netscape web browsers. The XUL language is mainly intended for cross platform development of essentially web based applications (see Trudelle [24] and Phanouriou [22 p. 32]).




  • The User Interface Markup Language (see uiml.org [26]) is another XML based language intended for use in defining user interfaces. It has a more theoretical foundation (see Phanouriou [22]) than the previously mentioned language XUL.


1.7.2 Dependent


  • Reusability in the user interface context is the state where the system developer can consistently reuse parts of the application not only on the same operating and programming language platforms but also crossing these boundaries, using the same parts on several platforms. (see Berard [1 p. 329,152] and Coad [4 p. 139])




  • Customizability in the user interface context is the state where a third party, not only the original system developer, can make changes to the user interface without having to use any proprietary or specialized technology.




  • Localizability in the user interface context is the state where any major script of the world can potentially be used as the language of the user interface.


1.8 Delimitations


We will look at:


  • The XML standard in relation to user interface development.

  • Different XML based user interface markup languages.

  • Current examples of user interface solutions developed using XML based markup languages.

  • Traditional methods and tools for user interface design.


We will not look at:


  • Specifics of the XML standard not relevant to user interface design.

  • Other uses of XML without parallel in or relevance to user interface design.


1.9 Target Audience


Our thesis is aimed at computer science students and professionals who have some degree of knowledge of the Extensible Markup Language (XML) or at least of markup languages in general.

2. Methods


A composite set of methods was used for testing the hypothesis (see 1.5). The limited amount of test material and the subjective nature of the area force us to look at the material in a purely qualitative way. No large-scale adoption of this technology has yet taken place so the available quantitative data is somewhat limited. We do however believe that by closely examining the structure of the XML language and it's derivative languages, examining the existing examples of use of this technology as well as, where possible, testing these languages ourselves and finally evaluating them with regard to previously stated key flexibility factors will enable us to draw a well founded conclusion.


The three methods we describe should be regarded as a whole. The theoretical segments cover some areas, which are not covered in the practical segments, and the practical segments add additional depth to the more theoretical areas.


2.1 Literature Study


The first method is a literature study entitled "Subject Overview" (see section 3) where facts were gathered about the independent variables XML, XUL and UIML. In this section we cover issues such as reusability, localization issues and customization. If we show that, XML as well as the derived languages XUL and UIML theoretically facilitates Reuse, Customization and Localization, we will be able use this to verify our hypothesis.


Our thesis is as previously discussed concerned with the introduction of derivative languages of XML into user interface development. This requires us to look into XML itself as well as examples of derivative languages. One factor in the choice of UIML and XUL as the derivative languages for investigation was their availability; we wanted to look at formats, which we were likely to be able to test on at least two platforms. Even though UIML and XUL are quite dissimilar they were both able to run on both the Win32 platforms (Win9X/ME/NT/2000) as well as on Linux. This enables us to look at two XML derivative languages, with different motivations and goals, from the perspectives of two separate platforms. We also looked at a number of alternative XML based technologies but they were either too platform specific or difficult to obtain. Even though all XML based languages, at least in theory, should be platform independent, the current implementation might not be. The available renderer might be Windows or Linux specific and not suitable for cross-platform development. XML was mainly investigated through the available literature although some informal practical experimentation helped us verify that our understanding of the subject was correct. UIML was investigated mainly through the available online resources such as the doctoral dissertation of Constantinos Phanouriou on the UIML2 language (see Phanouriou [22]), papers and tutorials provided by Harmonia, Inc and finally the UIML2 standards document. Another area of interest was Software Development and is as such referenced throughout this work but is not itself extensively covered. Although certain key concepts of software development such as OOP/A/D, Coupling, Cohesion etc. are certainly very important they are only a limited part of the field of software development and as such will be used to draw parallels to and explain certain aspect of our area of investigation.


2.2 Case Study


The second method used was a case study entitled "Impact of XML on the Mozilla Web-browser" (see section 4) on the impact of using the XML-based language XUL in the Mozilla project. The purpose of this was to find out how well this technology has worked in a real world application. In this section we cover issues such as reusability, localization issues and customization.


The reason for conducting this case study on XML in the Mozilla project and not any UIML related implementation is that XUL has very little in the way of formal literature and previous research while UIML has a good theoretical foundation. We look closer at the claimed theme and locale facilities as well as the claimed cross-platform nature of the Mozilla web browser in order to verify our hypothesis.


The term "themes" is a popularized term for individual centralized packages used to redefine the appearance of a certain application without the need for creating a completely new version of the program. This means that you could distribute the application with a number of different user selectable appearances and/or allow for proprietary (or third party) appearances (themes) to be downloaded and installed later. If we find that themes have successfully been implemented in the Mozilla web browser, enabling us to change the appearance of the application without the need for a re-installation, we will have shown that this particular application is indeed customizable.


Locales are simply centralized translation packages. They are similar to themes but concern the language specific textual content of the application, not the graphical layout. Implementing facilities for handling locales, enables proprietary and third party language packages to be developed independently of the application itself and distributed both with the application (mostly proprietary) and as separate downloads. If we find that mozilla has functional facilities for selecting independent locales, effectively changing the language for the entire application we will have shown that Mozilla is indeed localizable.


The claimed cross platform nature of the Mozilla web browser has been investigated by testing Mozilla on the two fundamentally different operating system platforms Win32 and Linux. We have also tried ty verify that the actual user interface code (XUL) used is exactly the same on both platforms. For this purpose a binary file comparison was performed on the user interface definition package "messenger.jar" for the Mozilla sub-application "Mozilla Mail & News" distributed with both Linux and Win32 distributions. If cross platform use of the Mozilla web browser application is found to be possible and if the user interface specific XUL code of the application on both platforms is found to be the same, it will have been shown that the application (and the user interface) is Reusable.


The case study was conducted on version 0.8.1 of Mozilla on both Windows 2000 and Linux. Mozilla was run on an Athlon 1GHz PC with 384MB of RAM (this should however not have an impact on the results, as we are measuring flexibility, not usability).


2.3 Practical Examples


The third method was to conduct two practical exercises using the XML-based languages XUL and UIML (see section 5). This method is intended not as an experiment, but as a corroborating and clarifying exercise in support of the issues already found in the previous sections. The XUL oriented exercise is intended to highlight the issues of Reuse, Customization and Localization. The UIML oriented exercise highlights the issues of Reuse and Customization. Localization is omitted in the latter exercise due to its absence from any actual implementations (It is however supported by the UIML language in theory.). If we show that, as a whole, the user interface definition languages XUL and UIML does practically facilitate Reuse, Customization and Localization, we will be able to use this to verify our hypothesis.


Two applications were developed in order to investigate some of the key features of each XML derived language (UIML and XUL). To develop UIML or XUL applications all you actually need is a simple text editor such as notepad (Win32) or Pico (Linux). However, there are more favorable editors available which offers a number of features such as syntax highlighting. One such editor is UltraEdit32, which together with the XML processor XML Spy has functioned as our main development tools. In UIML, application logic was added through a Java class. Compilation of this class was performed using the Java compiler included in the Java 2 Platform Standard edition (v1.3), which is also required for successful execution of the UIML Java rendering engine (version 0.7) used in our UIML examples. User interfaces developed in XUL were rendered through the Netscape Gecko rendering engine included in the Mozilla (version 0.8.1) web-browser. Both applications have been tested on win32 (Windows NT) and Linux (Red Hat 7.0) running on an AMD Athlon 1GHz equipped with 384MB of PC133 SDRAM but should be able to run on any PC capable of running the previously mentioned operating systems.


2.4 Shared Criteria


The results from each method will be measured against the same flexibility criteria as stated in the hypothesis and further specified in section 1.7.


3 Subject Overview

The purpose of this section is to function as an overview of and a reference to each subject that is a part of our investigation. A historical background as well as a survey of the underlying ideas and basic concepts is supplied in an attempt to clarify certain aspects that are central to each subject. First, there is an introduction to the XML format itself, followed by the XML based languages UIML and XUL.



3.1 XML



3.1.1 Introduction


The Extensible Markup Language (XML) has emerged as the format of choice for structured data in human readable form. It is a format for textual data representation and not for presentation as is the case with HTML. XML was derived from SGML (ISO 8879) and can like SGML be used to derive an infinite number of markup languages from. The problem with SGML is that it has been considered far to complex for many applications, that is not to say that it wouldn’t function, just that the cost of learning and developing with SGML has been considered to high (see Hunter [5 p. 12]). The problem with HTML is that it is too simple, while it is easy to create HTML documents, it is much harder (if not impossible) to expand the language gracefully. This is where XML comes in as a safe middleground between the complexity of SGML and the over-simplicity of HTML.


3.1.2 Textual Data


To better understand XML and markup languages in general we thought it best to elaborate a bit on the concepts of binary and textual data. There are essentially two ways for applications to represent data, binary and textual. Binary formats are by definition not readable by humans as each number is represented by a binary sequence and not a digit by digit character representation, as is the case with most textual formats. Textual formats are ideally suited for standardized data representation because you don't need the original program used to generate a file to read (and hopefully make sense of) it, you can simply open it up in your favorite text editor and read it as you would any other document. The drawback to textual formats is that they generally take up much more space than their binary counterparts. This has less and less of an impact over time though, as our computers grow more powerful (see Hunter [5 p. 10]).


The term "textual format" is quite broad and covers a number of character encoding standards such as ASCII, ISO 8859 and Unicode to name just a few. The required character encoding format for use with XML 1.0 (2000) is Unicode. The specification states that all XML processors should be able to read documents in the Unicode formats UTF-8 (of which 7 bit ASCII is technically a subset) and UTF-16. The Unicode character-encoding format allows for the use of thousands of characters and ideographs for a large number of current and historic scripts. This required support for Unicode in the XML format means that you could just as easily create an XML document using Chinese script as you could English or even one of the historic scripts such as Runic or Ogham (see Davis [14]).


3.1.3 Comparing XML to HTML


The XML format is a textual markup format for hierarchical data representation (see Hunter [5 p. 18]). The basic concept of markup for XML is the same as for HTML; the main difference is that HTML has a number of predefined elements while XML does not. Below you will find two examples, the first is a simple HTML document and the other is a similar XML document.






My HTML Document







A Basic HTML Document




Похожие:

Xml in the User Interface Context iconKeywords user interface, data model, automatic generation, screens, graphical user interface introduction

Xml in the User Interface Context iconCs 235: User Interface Design Fall 2010

Xml in the User Interface Context iconEncrypted Speech with a Familiar User-Interface Building a Secure Phone

Xml in the User Interface Context iconKeywords Metaphor; Reasoning; Creativity; Graphical interfaces; Interface user behaviour; Natural language interaction. Introduction

Xml in the User Interface Context iconXml, and its translation tool xslt, have become increasingly popular as document processing technology. Translation of documents is very simple once the user

Xml in the User Interface Context iconPubblicazioni A. Bertoni, C. Choffrut, B. Palano, Context-free grammar and xml languages, dlt 10th Inf. Conf., Lncs springer, 2006. Statistiche di pattern

Xml in the User Interface Context iconСвободная лицензия на использование xml схем компании «Эскорт»
Разрешается модификация xml схем в виде прямой модификации исходных файлов. Разрешается создание собственных xml схем используя включение...
Xml in the User Interface Context iconИнститут проблем рынка ран
Особое внимание уделяется проблемам интеграции технологий xml и баз данных. Оцениваются перспективы xml-платформы
Xml in the User Interface Context iconXml-xsl технология для построения интернет сайта Часть1: xml описание, css, новостной сайт
Описываются принципы использования xml-xsl технологии для построения интернет-сайта, ориентированного на небольшой поток новостей....
Xml in the User Interface Context iconKeywords Workflow Management Systems, xml store, Petri net, dpnml, Reactive xml, peer-2-peer and distributed system. Acknowledgement

Разместите кнопку на своём сайте:
Библиотека


База данных защищена авторским правом ©lib.znate.ru 2014
обратиться к администрации
Библиотека
Главная страница