Java SE 6 new features: XML APIs and Web services

Source: Internet
Author: User
Tags web services java se

At the end of 2006, Sun company released the final official version of Java Standard Edition 6 (Java SE 6), code-named Mustang (Mustang). Mustang has a good performance boost compared to Tiger (Java SE 5). Compared with Tiger's significant enhancements to the API library, although Mustang's new features in the API library appear to be few, it also offers a number of practical and handy features: scripting, XML and Web services, compiler APIs, databases, JMX, networking, and instrument There are good new features and enhancements in ation.

This series of articles focuses on some of the new features of the Java SE 6 in the API library, with examples and explanations to help developers better utilize Java SE 6 in programming practices to improve development efficiency. This article is the last of a series that introduces the XML processing framework provided in Java SE 6 and the powerful support for WEB services provided with annotation (Annotation) technology on top of this framework.

As a development platform, Java SE 6 provides a wide range of technical frameworks for different application development needs. The XML processing framework is one of the key components of JDK 6. It provides application developers with a unified XML processing API. This framework has two roles: on the one hand, developers can transparently replace XML processing services provided by different vendors through these frameworks, and service providers can insert their products into the JDK through these frameworks. This framework is generally referred to as the Service Provider mechanism. The XML processing capabilities of Java SE 6 are divided into two parts: XML processing (JAXP) and XML binding (JAXB). On top of the XML processing framework, Java SE 6 combines annotation (Annotation) technology to provide powerful support for WEB services.

This paper first introduces the Service Provider mechanism and its application in the XML framework. It then introduces the functionality of the XML framework in Java SE 6, including the sax,stax,dom three mechanisms. Finally, we introduce the technology of building WEB services on this basis. JAXB is closely related to the development of Web services, so the introduction of JAXB is also covered in the Web Services section. The content of this article is based on the Java SE 6 SDK.

Service Provider mechanism

For the same function, different manufacturers will provide different products, such as different brands of tires, plugs and so on. The same is true in the software industry. For example, for encryption and decryption of data, different manufacturers use different algorithms to provide different software packages of varying intensities. Depending on the development requirements of the application software, it is often necessary to use different packages. Each time a different package is replaced, the following procedure is repeated: Change the application software code-> recompile the-> test-> deployment. This practice is commonly referred to as development-time binding. This is actually a relatively primitive approach, with a lack of flexibility and openness. The practice of applying runtime binding service providers is thus prevalent. This is done by using a configuration file and then loading the implementation at run time. The Service Provider mechanism provided by the Java SE platform is a compromise between development-time binding and run-time binding, well satisfying the two requirements for efficiency and openness.

Forming a service Provider framework requires roughly three parts, and figure 1 shows a typical service Provider component structure. Most service Provider frameworks for the Java SE platform provide 3 main components: A developer-oriented application interface, service Provider interface for a provider, and a true service provider.

Figure 1. Component structure for Service Provider

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.