Java & J2EE Integrating XML with J2EE |
Throughout the book so far, you have seen many ways in which XML is used within J2EE applications to describe the structure and layout of the application. Today and tomorrow, you will study XML and its associated APIs and standards to gain a fuller understanding of how XML can be used to exchange data between different components in your applications. Today, you will learn about
This book is about J2EE, of which XML is just a component. To learn more about XML, take a look at Sams Teach Yourself XML in 21 Days, which covers everything you need to know about XML and related standards. The Drive to Platform-Independent Data Exchange Applications essentially consist of two parts—functionality described by the code and the data that is manipulated by the code. The in-memory storage and management of data is a key part of any programming language and environment. Within a single application, the programmer is free to decide how the data is stored and represented. Problems only start when the application must exchange data with another application. One solution is to use an intermediary storage medium, such as a database, and standard tools, such as SQL and JDBC, to gain access to the data in such databases. But what if the data is to be exchanged directly between two applications, or the applications cannot access the same database? In this case, the data must be encoded in some particular format as it is produced, so that its structure and contents can be understood when it is consumed. This has often resulted in the creation of application-specific data formats, such as binary data files (.dat files) or text-based configuration files (.ini, .rc, .conf, and so on), in which applications store their information. Similarly, when exchanging information between applications, purpose-specific formats have arisen to address particular needs. Again, these formats can be text-based, such as HTML for encoding how to display the encapsulated data, or binary, such as those used for sending remote procedure calls. In either case, there tends to be a lack of flexibility in the data representation, causing problems when versions change or when data needs to be exchanged between disparate applications, frequently from different vendors. XML was developed to address these issues. Because XML is written in plain text, and shares similarities with HTML but uses self-describing elements, XML provides a data encoding format that is
blog comments powered by Disqus |