当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: Java Servlets and JavaServe
 

 

 ·distributed logging using the jms @ jdj    »显示摘要«
    摘要: every software system has logging requirements so application processing can be monitored and tracked. modern distributed systems, which are usually based on application frameworks, require a ......
 ·intellij idea 4.0 @ jdj    »显示摘要«
    摘要:the integrated development environment (ide) is a big part of the toolkit of a modern software developer. java projects have complex development processes, especially if the project is going to be dev......


Growing JSP And Servlet Sites @ JDJ

java servlets and javaserver pages (jsp) threaten to collapse out there in the mud houses of server land. developers succumb to the temptation to muddle their pages with complex business logic, and to fill behemoth proprietary libraries with data and subsystem access routines. we find stronger solutions in ejb-based architectures than in fattened jsps, but molding existing sites into ejb-centric designs strikes most of us as a daunting and expensive task.

however, there are clear guidelines for evolving the jsp and custom code approach into a more flexible ejb-based architecture. once convinced that the endeavor is both worthwhile and feasible, developers can take steps to pare down servlets and jsps to simple mvc-compliant presentation layer elements that elegantly access hard-core logic in the form of decoupled and refactored ejbs. this is the practice of growing a jsp site into a full-blown j2ee application.

jsp anti-patterns

in designing software, most of us will agree that mixing presentation logic and business logic is a naughty thing to do. in practice, however, jsps do not naturally lend themselves to a decoupling of these layers, often leading us to compromise our design aesthetics in favor of implementation convenience. after all, were not html designers. we know java, and we dont mind plopping java routines right in the middle of our pages. its quick and dirty. eventually, as the business logic in the pages grows more complex and touches more external subsystems (databases, mail servers, custom proprietary servers), our cool apps coalesce into great balls of mud. figure 1 illustrates such a scenario, in which the client event handlers perform business logic that includes enterprise-level resource usage.

its not that a pattern has become obscured in such cases; its that an anti-pattern has emerged. anti-patterns begin as compelling solutions that result in the eventual amplification of the problems they address. in particular, many jsp and servlet sites follow the blob and stovepipe anti-patterns, in which originally compelling code spirals out of control and sprouts numerous tightly coupled subsystems. designers, developers, and engineers step on one anothers toes to turn simple systems into sophisticated ones. the web apps developed in this manner are akin to a house in which cleaning the windows inexplicably causes the roof to leak. the situation grows even uglier when new teams take charge of maintaining the code. justifying the code blob under the "controller" mvc label doesnt resolve the practical problem, even if it sounds promising in high-level architectural discussions.

lengthy procedural code is more
...   下一页

 ·xmlspy2004 and mapforce2004 @ jdj    »显示摘要«
    摘要:if you are an enterprise or xml developer and wish you had a tool that could make your life easier, check out this review as it discusses two of the most useful tools in the industry. xmlspy is more t......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE