📄 lib0074.html
字号:
<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Architectural Guidelines</title>
<link rel="STYLESHEET" type="text/css" href="images/xpolecat.css">
<link rel="STYLESHEET" type="text/css" href="images/ie.content.css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/teamlib.gif" width="62" height="15" border="0" align="absmiddle" alt="Team LiB"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href="LiB0073.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0075.html"><img src="images/next.gif" width="41" height="15" border="0" align="absmiddle" alt="Next Section"></a>
</div></td></tr></table>
<br>
<div class="chapter">
<a name="ch11"></a>
<div class="section">
<h2 class="first-section-title"><a name="351"></a><a name="ch11lev1sec2"></a>Architectural Guidelines</h2><a name="352"></a><a name="IDX-145"></a>
<p class="para">
<b class="bold">Avoid direct use of the DOM to interpret XML data.</b> It is faster to develop and easier to maintain applications using complementary technologies, such as JAXB or JDOM, than using a DOM parser directly.</p>
<p class="para">My preference is JAXB, which generates Java source code that can read, interpret, and serialize XML documents conforming to a given schema. The advantages of JAXB are that it maps XML documents to Java classes that are easy for developers to use, and the learning curve for JAXB is short.</p>
<p class="para">
<b class="bold">Apply XML technologies consistently throughout the application.</b> Whatever your technology choices are, there is a tremendous benefit to consistency. For instance, if the developers of your application prefer JDOM and are comfortable with that choice, you have little reason to use JAXB. Consistency makes the application easier to maintain because it reduces the skill sets required for maintenance developers. Consistency also reduces the time it takes to investigate bugs because maintenance developers can begin with a base understanding as to how XAOs are structured.</p>
<p class="last-para">
<b class="bold">Place XML-related code into separate classes.</b> One reason for separating XML-related classes from those that implement business rules is to insulate your application from changes in XML document structure. Another reason is that separating XML document interpretation and business logic can lead to simpler code. Further, if multiple applications must read and interpret the same XML document formats, keeping XML-related code separate makes it easier to share that code across applications.</p>
</div>
</div><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/teamlib.gif" width="62" height="15" border="0" align="absmiddle" alt="Team LiB"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href="LiB0073.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0075.html"><img src="images/next.gif" width="41" height="15" border="0" align="absmiddle" alt="Next Section"></a>
</div></td></tr></table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -