You are on page 1of 2

What is the purpose of decoupling application layout into XML files instead of embedding it into

the application Java code? What is good or bad about this design?

WHAT IS XML?
XML is simply an acronym for eXtensible Markup Language, and it enables people and
computers to search for and exchange scientific/business data, commercial products, and
multilingual products with ease and speed.
XML technology provides a method for tagging (or marking up) text in the document so that the
meaning of its components can be esablished, thereby allowing for the documents use in multiple
applications. Ulike HTML (which has the aforementioned limitations), XML allows for userdefined tags and attributes, and its uses stretch far beyond just presentation of material. Because
you can create your own tags and attributes in XML, you can use markup to describe the content
of the element. In otherwords, XML is just a way of marking up data so that it is self-describing.
Key Design Principles

The eXtended markup language (XML) is a metalanguage -- that is, a language for
describing other languages.

XML does not have a fixed set of markup tags -- instead, authors create their own markup
language for describing structured data.

XML has built-in internationalization (full Unicode) and platform independence.

Web page content is separated from presentation -- applications decide how the data will
be displayed.

XML is an open standard developed by the World Wide Web consortium (W3C). This means that
XML is non-proprietary and can be used with a wide range of applications, including authoring
tools (e.g., better tag semantics for specialist information), content display engines (i.e., different
views of the same data), translation tools, and database exchange/applications.
Separation of Data and Presentation
XML Technology employs three languages:

XML. The extensible markup language specifies the base syntax of documents and
document type definitions (DTDs).

XSL. The extensible stylesheet language specifies the appearance of a document.

XLL. The extensible linking language specifies links among documents (e.g., associates
semantics to a link; define a link that connects more than two resources; define a
bidirectional link).

Note. The specification of a document's contents (XML) is completely separated from the
formatting instructions (XSL).
COMPLEMENTARY BENEFITS OF JAVA AND XML

We want software components that:

Have self-constrained and well-defined functionality.

Have open interfaces that offer "plug-and-play" high level application services.

Can be dynamically distributed across the Internet for reuse.

Benefits of Java:

Java bytecode is portable -- therefore, can reuse software components across


heterogeneous computing platforms (write once, run anywhere).

Benefits of XML:

XML allows for custom interpretation of data sets (write once, publish anywhere).

Application categories include:


Those requiring the web client to present different views of the data to different users.
Those requiring the web client to mediate between two or more heterogeneous databases
(e.g., to publish or exchange database contents).
Those wishing to distribute a significant proportion of the processing load from the web
server to the web client.
Perhaps the biggest reason is to assist in the creation of tools for view
definition, such as a GUI builder in an IDE like Eclipse or a dedicated
Android GUI designer like DroidDraw. Such GUI builders could, in
principle, generate Java code instead of XML. The challenge is re-reading
the definition in to support edits that is far simpler if the data is in a
structured format like XML than in a programming language. Moreover,
keeping the generated bits separated out from hand-written code makes it
less likely that somebody's custom-crafted source will get clobbered by
accident when the generated bits get re-generated. XML forms a nice
middle ground between something that is easy for tool-writers to use and
easy for programmers to work with by hand as needed.

You might also like