📄 lib0027.html
字号:
<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>External Interface 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="LiB0026.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0028.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="ch04"></a>
<div class="section">
<h2 class="first-section-title"><a name="121"></a><a name="ch04lev1sec4"></a>External Interface Guidelines</h2><p class="first-para">Many J2EE applications communicate with external systems, some of which may not be Java applications. As a technical architect, you'll probably have an opportunity to facilitate design and implementation of external interfaces. Over the years, I've adopted several techniques for creating successful external interfaces.</p>
<p class="para">
<b class="bold">Record every request or transmission from or to an external application.</b> This should be the first task in any external interface. Be sure to log this information so that you know the time (and node if you're in a clustered environment). If there's a problem with work you initiated in an external application, you'll want to be able to tell those developers exactly what calls they made and when. If there's a problem processing a call from an external application, you'll want enough information to replicate it and fix any problems quickly.</p>
<a name="122"></a><a name="IDX-44"></a>
<p class="para">This documentation practice helps prevent you or any member of the development team from being blamed for the mistakes of others. Without facts, anyone can make accusations, and in too many corporations, you're guilty until proven innocent. Having a transmission log will make it easier to determine which application has a problem.</p>
<p class="para">
<b class="bold">Create a way for an application administrator to resubmit a work request</b> <b class="bold">from an external application.</b> When your application experiences an environmental problem and you're able to fix it, the application administrator should be able to resubmit the work that failed. This limits the impact on end users and limits the number of people (and thus the time) needed to fix a problem. Sometimes, resubmission isn't possible or applicable. But it can save you time for activities that are more fun than maintenance.</p>
<p class="para">As an example, one of the applications I supported provided scheduled reporting capabilities. An application administrator could resubmit any report that wasn't being delivered to a browser by an administrative Web-based utility.</p>
<p class="para">
<b class="bold">Collect the identity of the transmitter.</b> Part of every transmission should be information that indicates the identity of the caller. This is meant as a way to reduce your maintenance time, not as a security mechanism. In the case of an inappropriate call, you want to be able to quickly notify the application making it. If you don't know where it's coming from, finding it and getting it fixed takes longer.</p>
<p class="para">
<b class="bold">Develop a mechanical way to "push" errors to the transmitter.</b> If there is a problem processing a request made by an external application, administrators from that application need to be notified. If the interface has a tight coupling (e.g., session bean, RMI service), all you have to do is throw an exception. Whatever mechanism the external application uses for error processing will be able to handle the error.</p>
<p class="last-para">If the interface has a loose coupling (e.g., uses messaging technologies), you need to construct a way to mechanically notify administrators from the external application of the error. Most often, I've seen e-mail used as an effective error notification channel for these cases. As most alphanumeric pages accept e-mails, paging is a possibility. However, I would thoroughly test your error processing before hooking it up to a pager.</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="LiB0026.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0028.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 + -