kukooBlog

look to the master, follow the master, walk with the master, see through the master, become the master.

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  213 随笔 :: 0 文章 :: 285 评论 :: 0 Trackbacks

At one end of a typical web application is the presentation layer. Many Java developers understand what Struts provides. However, too often, coupled code such as business logic is placed into an org.apache.struts.Action. So, let's agree on what a framework like Struts should provide. Here is what Struts is responsible for:

 

  • Managing requests and responses for a user.
  • Providing a controller to delegate calls to business logic and other upstream processes.
  • Handling exceptions from other tiers that throw exceptions to a Struts Action.
  • Assembling a model that can be presented in a view.
  • Performing UI validation.

 

Here are some items that are often coded using Struts but should not be associated with the presentation layer:

 

  • Direct communication with the database, such as JDBC calls.
  • Business logic and validation related to your application.
  • Transaction management.
  • Introducing this type of code in the presentation layer leads to type coupling and cumbersome maintenance.

 

Excerpt from "Wiring Your Web Application with Open Source Java" by Mark Eagle

 

[NoteThis blog was migrated from my very old blog which was in the blogspirit.]


Yourit
Mycat Programming

posted on 2005-06-02 09:17 kukooBlog 阅读(818) 评论(0)  编辑  收藏 所属分类: JavaProgramming

只有注册用户登录后才能发表评论。


网站导航: