Values of XML, Java, and xmlbeans in combination with Applications

Source: Internet
Author: User
By reading this article, you will understand how Service-Oriented Architecture (SOA), XML, and xmlbeans play an important role in solving practical business problems and the causes, this article will take the entertainment industry as an example for case analysis. The purpose of this article is not to introduce Code , But to let you know how to use xmlbeans and Its Causes when you need to use XML.

Faced with the ever-increasing complexity of software, Enterprise Architects gradually focus on an object-oriented Architecture (SOA), which can solve system integration problems ). In essence, SOA is to improve enterprise efficiency by enhancing the operational relationship between businesses and information technology (IT.

SOA applies request/response design examples to synchronous and asynchronous applicationsProgram. In this method, the logic and functions of business applications are presented as services. Application developers or system integrators can combine one or more services to build applications without having to know the underlying implementation of services. In this way, you can actually integrate all IT resources, including Isolated Data and legacy systems that were previously incompatible.

In the SOA example, the provider communicates with the consumer through messages. The message passing interface must be independent of the platform and language. Therefore, messages are usually constructed using XML documents that conform to the XML format. Of course, application data is often stored in XML format.

XML provides basic syntax that allows you to share information between various computers, applications, and organizations without the need for multi-layer conversion. XML is important because it provides a general standardized platform for building an integrated infrastructure to support enterprise application integration.

Why use xmlbeans?

Xmlbeans can be usedProgramming LanguageUsed in combination with XML. Java programming language is an object-oriented language based on open and open standards. It can be transplanted, robust, and reliable. With these features, Java programming language has been widely accepted and implemented in many industries, including the entertainment industry. However, XML is not compatible with the Java programming language. Xmlbeans is the best choice to clear this obstacle.

Xmlbeans is used for binding XML data. With xmlbeans, Java applications can take full advantage of XML. Xmlbeans uses XML schema to compile Java interfaces and classes used to access and modify XML instance data. With this technology, you can compile the XML schema into a set of Java classes so that it has the following functions:

Use xmlbeans in case of any Schema
Access XML data at any level as needed
Xmlbeans provides the following application APIs for Data Binding:

Xmlobject: If Java classes are generated through XML schema, these Java classes are derived from the xmlobject API.
Xmlcursor: The xmlcursor API provides lower-level access to XML infoset, which indicates the cursor position in the XML instance.
Schematype: an XML schema object model used for underlying metadata.

The xmlbeans compiler generates an object representation in XML mode. This object represents a group of generic Java classes and interfaces that represent schema structures and constraints. After the Java class and interface are generated, the XML instance document that conforms to the pattern is bound to it. The binding process includes using the xmlbeans API in an object-oriented manner to access data in the actual XML instance documentation.

If you use powerful xmlbeans, you do not need to write all the code to use XML. You can easily use XML in applications. If xmlbeans is not used, you must write code to use each part of the schema. Imagine: Using xmlbeans to generate classes in the pattern. Assuming that there are several one-to-one, one-to-many, and many-to-many relationships that need to be managed, xmlbeans can easily accomplish this task:

Install xmlbeans.
Compile mode to generate a Java archive (jar) file.
Write code to bind the XML instance to the Java type that represents the mode. Listing 1 provides a simple example:
Listing 1. xmlbeans ease of use

File xmlentertainfile = new file ("C:/entertain. xml ");
// Bind the instance to the xmlbeans types that were generated.
Entertaindocument entdoc =
Entertaindocument. Factory. parse (xmlentertainfile );
// Get and then print pieces of the XML instance.
Entertain ent = entdoc. getentertain ();
Entertain [] entarray = Ent. getentertainarray ();
For (INT I = 0; I <entarray. length; I ++)
{
System. Out. println (entarray);
}

Entertainment Industry

So how is all of this implemented in the real world? First, the computing power has undergone an incredible change. With the popularization of SOA, the computing capability is becoming more and more from the traditional Star Model (in this model, high-performance servers form a hub together) to a more peer-to-peer model, the advantage of a combined network is that it has more powerful computing power than a central server. In fact, the central server becomes a node in the network. With the development of Internet and high-speed Internet connections, the entertainment industry is going digital. Sales and release of most new products have been or will be digitalized.

Believe it or not, the entertainment industry has become one of the first industries to take advantage of this transformation because of the notorious Napster's adoption of this computing paradigm. A recent seminar by South by Southwest (sxsw, Inc.) also proved that the entertainment industry is still a pioneer. Sxsw is a private company located in Austin, Texas. The company specializes in conferences and festivals for entertainment and related media professionals. The company's recent meeting (March 11-14, 2006) discussed tools that can be used by digital creators and filmmakers during development and production. One group focused on developing XML applications in the entertainment industry: Looking for XML in all the wrong places. In the company's meeting materials, "everyone wants to do everything with XML ."

Film Industry

The film industry is even more enthusiastic about XML. The film industry has made significant strides in packaging and distributing digital products to cinemas and other entities, including the use of XML. In collaboration with the social ety of motion picture and television engineers, SMPTE Standards Committee, the Digital Cinema Initiatives (DCI) organization devoted to film digitalization in July 2005, released the system specifications for digital cinemas recognized by mainstream film production companies. The standard covers the use of XML in packaging, file format, frame rate and speed control, editing playlist and packaging list.

Many new applications for the film industry can be found on the network, such as Apple's award winning software Final Cut Pro, which supports open, standard-based XML interchange format. In Final Cut Pro, XML interchange format describes all aspects of the project. Final Cut Pro provides the creative and programming staff with a way to find the highlights of the video design from cutting, hanging film and fragment, cutting, transfer and effect to color setting and key frames. Using XML in Final Cut Pro provides you with an open and transparent plain text format that can be read and manipulated using a variety of tools. Using XML interchange format means that Final Cut Pro users can interact with any application or system that supports XML (including database systems, network servers, HTML-based web creation tools, and graphical applications) share various project information. It also means that Java-based applications can use xmlbeans to easily access the data. Now, developers can create Java-based applications fully integrated with Final Cut Pro, and build custom post-production pipelines that save a lot of time and money, thanks to xmlbeans.

Xmlbeans and industry release

Of course, the most important thing to consider after the post-production is release. If you do not release the product, there will be no profit. Through agents such as Amazon.com, Internet has become an important part of various forms of media products (such as DVDs, various types of music, and of course books. Many people know that Amazon.com is a book dealer. In fact, it is also a member of the publishing network in the entertainment industry. Amazon Web Services (AWS), composed of XML-based protocols, provides direct access to Amazon's technical platforms and product data, from retrieving information about a group of products to placing products in a shopping cart, this improves application performance or adds better search functions. With AWS, you can directly access Amazon's powerful platform to enable and enhance your applications.

Amazon.com is not the only Internet resource in the entertainment industry. Entities such as netflix.com are also part of the distribution network. Netflix uses the Really Simple Syndication feed to provide access to its content. Developers can use RSS feeds to create interesting new methods to display information provided by Netflix. Of course, RSS feeds are not limited to Netflix. You can find XML-supported documents on many sites, such as those of news agencies and content providers.

It can be imagined that this new approach will not only bring about huge profits, but will hardly cause any problems related to digital rights management (DRM) and piracy. With the development of new distribution channels, film and television producers (such as studios and independent production rooms) must be able to interact with interested parties (including cinemas, TV stations, leasing providers and paid on-demand video providers. At present, several members in the industry are discussing with e-commerce organizations how to be profitable, secure, and reliable when using the latest or most cost-effective distribution channel such as Internet to issue film and TV works. This interaction constitutes a DRM-related issue.

The key to the widespread use of xmlbeans is the establishment of open XML standards accepted by the entertainment industry. However, if you want to create entertainment programs and have XML encoding standards (even your own XML Schema), you can use xmlbeans. With XML (standard or not), you can use xmlbeans to improve creation efficiency, reduce the code that must be tested and maintained, and achieve loosely coupled and more service-oriented goals. After adding the XML standard to the DRM field, you can also use xmlbeans to implement and use the standard. Through this article and otherArticleThe technical advantages of xmlbeans listed in, you can see a consistent method to apply the DRM standard, which helps you simplify the deployment and exchange copyright data with partners, publishers and customers. The next generation of standards in the DRM field is open digital copyright language (odrl ). You can download the XML mode from the odrl site.

To download the XML mode from the odrl site, perform the following steps:

Download and install xmlbeans and the container in which the code will be deployed.
Search Expression Language schema and data dictionary schema on the odrl site, and save the file to the container you created.
Visit the xmlbeans web site and generate xmlbeans through the XML mode file. Select the option to save the Java source file. The generated xmltypes. jar file contains the classes required to use odrl and xmlbeans.
Xmlbeans has many other advantages. Xmlbeans may be the most mature XML Object binding technology on the market, and it is free of charge. In short, xmlbeans is definitely a tool you need to consider when using XML values. With the rapid development of XML applications in the entertainment industry, you can easily see the advantages of xmlbeans if you want to make XML content available for Java-based applications.

Conclusion

The entertainment industry uses XML for many applications on multiple levels. As Java programming language is the world's standard object-oriented programming language, and XML has become the preferred data format for the entertainment industry, xmlbeans will soon become the preferred Java binding tool. Xmlbeans can be used to create classes for Java development to avoid repetitive work and save time and cost. The combination of the two provides effective methods for developing customer and supplier applications 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.