Client application based on XML / XSLT
Here, we assume that you have a basic understanding of XML, I will focus on discussing the development of their front-end applications. One main feature developed with XML-related user interface is that the content and expression methods are not interfere. Simply, the data is saved as an XML document, and no longer responsible for the use and display of data. Select in HTML, WML, XHTML, and other expression forms based on the status table (XSLT) of the data format and the output mode on the web page. A data expression form. By maintaining relative independence between the layers, each layer processes the respective tasks, the advantage of this method is very obvious.
Although XML provides a good data release mode, you can generate different expression modes, which still cannot solve all problems. The XML is worthy of the truth that developers focus on the processing of data, and allows designers and artists to deal with data. The application saves the generated XML file in memory or stored on the disk, to obtain the specified expression type, such as HTML, can convert the content by the appropriate XSLT type table, which can convert XML documents to HTML documents . The contents of the type table and the determination document should be distributed to templates on the web page. It also converts data, performs traditional commands and loops to process data, making decisions, so it may become very complicated.
One of the advantages of the type table is that if you want to access the same application from a mobile phone, all the work you need is to create a new WML type table. In theory, all other parts of this application do not need to be changed, which makes the server-side programming work very efficient. Implementing a front-end application using XML will make some tasks simple, because the data displayed and the code that handles these data does not need to be changed. Development teams in developing applications can work independently to accelerate the development process.
However, I have eaten in the development of XML-based front-end applications, and the two most important disadvantages are the lack of tools and processing speeds for the generation of XML and type development, the first factor for those who use Dreamweaver and FrontPage and other visual HTML development tools have greater impact on developers who create HTML web pages. As far as I personally, I still like to use Dreamweaver, but I can't get what is fun from writing HTML code in the text editor. After all, it is already a very simple XSLT type table that is a very simple XSLT type table that converts XML documents to HTML:
XML Version = "1.0"?>
We will find that the above code is not the same as the code we get with the HTML development tool. Unfortunately, we must edit it with manual way, and then process it in a tool that can generate an HTML document, and then open the generated document in the browser. If you only change the size of the font, then you don't have to do this.
The second problem is to do all tasks for many times at runtime. If the data format is not XML, you also need to generate an XML document, and the HTML code can be generated after the Type Table is converted. The speed and simpleness are not based on the advantages of XML-based front-end applications compared to the memory cache in the servlet or JSP application.
All in all, if you need to dynamically generate different layouts and forms of expression form, you need to use XML. If the expression of expression needs to change frequently or is very flexible, you should let the designer will redesign the new type of type. What needs to be remembered is that the designer as long as the XML and XSLT are all right.
Another XML-based UI occasion is that the information you need to process is an XML document, not a Java object or relational database. XML is a new technology in the future, however, currently using JSP development front-end applications is not more convenient, especially HTML is the only front-end development tool. Some famous design modes such as JavaBeans and JSP identity libraries can make the contents and expressions of the data. With the automatic use of the tools for editing XML / XSLT, these technologies will be more simple and convenient.
in conclusion
Specifically to your own Java app, these three front-end technologies have their own advantages and disadvantages, and any technology cannot exceed the other two in all aspects. For specific applications, we must analyze the needs and users' expectations, and evaluate these three technologies. Here are some basic guidelines: use HTML / JSP:
━━ Suitable for static content consisting of a large number of graphics and artwork.
The interface of the front-end application is used for users of all platforms.
━━ The internet connection used by the user is slow.
━━ Hopefully build a single application of a single application.
Use Java Swing:
━ Suitable for creating a GUI with a built-in, related logic related to the interface.
━━ 减 网络 网络 网络 网络 流,, 尽. 即..
━━ If the user has a high quality and functionality of the interface.
━━ If the functionality of the UI is more important than its beauty.
Use XML / XSLT
━━ Need to support many different and frequently changed forms.
━ 数据 Data is XML format.
━━ ━ 需要 needs personalization.
━━ Plan a different way of access to wireless access.