When is the use of XML in the EJB system

zhaozj2021-02-11  196

When is the use of XML in the EJB system

XML is a very popular word, we now discuss the applicability of XML in EJB development. XML is suitable for the following cases:

1. As an interface to the Legacy system. If you have a huge Legacy system, or you have a big horrible Legacy system, then you will need to view the data you sent from the Legacy system, this time XML can help you. Not to send data of the appropriate structure that the Legacy system can understand, but you can invent an XML Facade for that Legacy system. The FACADE gets XML input from the EJB component, then maps XML to the appropriate structure supported by the Legacy system. When the Legacy system returns the data for your EJB application, the XML Facade converts the Legacy data into XML data that you know by your EJB application. This is also useful for business analysts that handle J2EE applications. They can use XML to help operate data mappings, while XML is a very easy-to-understand technology.

2. As a document persistence mechanism. When you persist in a large number of documents (such as news reports, articles, books, etc.), which is appropriate to use XML.

3. As a web service interface. The EJB component can be encapsulated into a web service. XML is an online data format that is transmitted between web services. How do we build a white paper based on Web Service-based J2EE, and how to call Web Service from another J2EE system, at www.theserverside.com.

There is an important case that XML is not very useful, that is, online format of communication between EJB components. This idea is more than just application components to send appropriate data but to interoperability between components to communicate with each other by using XML as parameters. Because the data uses the XML format, each component can check the XML document to determine what data is received. Although some J2EE-based process solutions use this method, XML does not apply to communication between EJB components, because performance issues. Analysis of the XML document takes time, it takes longer to transfer XML documents online. For high performance enterprise-class applications, use XML costs in runtime or in conventional operations too high. When the XML parser becomes more efficient, when people start using text compression to transfer XML documents online, the performance burden is not so important. However, this is still a bottleneck of many systems.

Another important reason for using XML is because he usually does not need to be applied. Suppose a separate body wrote all your EJB components, XML may not be used because there are little data mapping between different systems, since you control the object model.

转载请注明原文地址:https://www.9cbs.com/read-5232.html

New Post(0)