Currently, the Java 2 Platform Enterprise version (EE) architecture is highly respected in both the vendor market and the developer community. As a tool, Extensible Markup Language (XML) simplifies data exchange, interprocess messaging, and thus becomes attractive to developers and is becoming popular. Naturally, the idea of accessing or integrating XML solutions in the Java EE architecture is also tempting. Because it will be a combination of a strong system architecture and a highly flexible data management solution.
XML applications seem to be endless, but they can be broadly grouped into three broad categories:
* Presentation and exchange of simple data (simple API for XML (SAX) and Document Object Model (DOM) syntax parsing, different document type definitions (DTDs) and Profiles (schemas))
* Message-oriented computing (XML-RPC (remote procedure Call), SOAP protocol, Electronic Business XML (EbXML))
* User interface related, presentation-related contexts (Extensible Stylesheet Language (XSL), Extensible Stylesheet Language Transformation (XSLT))
These types of applications happen to have a natural counterpart in the Java EE Architecture: Data representation and switching functions are part of the persistent service (persistence services) in the EJB component model, and message based communication is handled by the Java-based messaging Service (JMS) API. The interface representation is the Java Server Page (JSP) and Java Servlets's forte.
In this article, we will see how XML is applied in these areas in today's Java based applications, and how these applications will evolve in future versions of the relevant standards.
Fundamentals: Representation and exchange of data
The content of a prototype XML application (if any) is usually that the data is stored in XML format and is often read into an object model for display, modification, or even writing to an XML document. As an example, assume that we are working on multiple types of media (graphics, video, text documents, and so on) and use the following simple XML DTD to describe the metadata for these media:
!--DTD for a hypothetical media management system-->
!--Media assets are the root of the object Hierarch Y. Assets are also
Hierarchical-they can contain other Assets.-->
ELEMENT media-asset (name, DESC, type*, media-asset*, urn) >
!--Metadata about the asset-->
! ELEMENT name (#PCDATA) >
! ELEMENT Desc (#PCDATA) >
! ELEMENT type (desc, mime-type?) >
! ELEMENT Mime-type (#PCDATA) >
! ELEMENT urn (#PCDATA) >
The following is an XML document based on the above media DTD that describes what is relevant to a course Lecture:
14th speak
all related to 14th a set of subcomponents of the!--Content object "Lecture 14"-->
Slides for lectures
MS PowerPoint
application/ Vnd.ms-powerpoint
http://javatraining.org/jaf/E123/lecture-14/slides.ppt
video clips for lectures
RealPlayer streaming videos
video/ Vnd.rn-realvideo
http://javatraining.org/jaf/E123/lecture-14/lecture.rv
!--lectures start-->
http://javatraining.org/jaf/E123/lecture-14/index.jsp