J2EE学习笔记(4) 软件工程与系统框架
J道的老大banq曾经说过设计模式是衡量一个程序员水平高低最重要的标准。个人非常赞同这个观点,从这个角度看学好J2EE第一个要了解的就是作为一个庞大复杂的系统,它是如何由各个模块拼装并协同有效地运作。先来几个定义暖暖身 Definitions of Different Dimensions in J2EE
Tiers: A logical or physical organization of components into an ordered chain of service providers and consumers. Components within a tier typically consume the services of those in an "adjacent" provider tier and provide services to one or more "adjacent" consumer tiers. Within a tier, services are grouped to like requirements, such as functionality, security, or load distribution.
Layers: The hardware and software stack that hosts services within a given tier. Physical, network, and software platforms and standard API sets support the components that provide a service. Layers, like tiers, represent a well-ordered relationship across boundaries that are mediated by interfaces. Whereas tiers represent processing chains across components, layers represent container/component relationships in implementation and deployment of services.
Tiers层的概念是我们最常听到的,一般来说它可以分为 (客户) <---交互---> [ Client Interface --- Presentation Tier --- BizLogic Tier --- Integration Tier --- Resource Tier ]
Client Interface 典型的客户界面为IE, Swing, Applet, WAP等,客户与之直接交互
Presentation Tier 负责接受客户请求并返回相应的处理结果。登陆,权限检查,会话管理在此进行,从技术角度就是JSP HTML等
Business Logic Tier 负责处理业务逻辑和数据,是J2EE的核心,它也同时管理事务Transaction,EJB等在这一层
Integration Tier 负责连接业务逻辑层与系统资源层,最常见的JDBC数据库连接就是一个例子
Resource Tier 负责提供上层所需要的资源,比如数据库, File System, Legacy System等等
结合实际应用和设计模式,我们可以将层次进一步划分。多层次会降低效率,也会导致出现很多看似“无用”的代码,但正是这些代码实现了低耦合从而降低了后期维护成本。
1) Presentation Tier应用MVC模式, 将程序流程控制器(Controller) 视图(View)和数据三者分离,如Struts就是其中一员大将。Filtering和User-Role-Priviledge-Resource也常在使用(具体还会开新贴细谈)
2) Business Logic Tier 和Presentation Tier的低耦合由Business Delegate层实现,很典型的例子 BusinessDelegate -> BusinessMgr (EJB) -> ...而Facade模式也经常在这里被用来做封装。
主要参考文献:软件体系架构模式在J2EE中的应用
主要参考项目:Medlog Logistic PACE2 SCS
↓相关文章:
- · J2EE学习笔记(3) Struts Logic Tags
- · J2EE学习笔记(1) 开篇
- · J2EE设计模式学习笔记之--用实体组件进行数据存取
- · WSAD5.1+oracle9i在一台机器上的问题ora-00600-参考
- · Jboss下MS SQL Server配置指导
- · J2EE应用部署(一):基础篇
- · 漫谈EJB (3)
- · 漫谈EJB (1)
- · J2EE应用部署(二):
- · JBuilder7+Weblogic7+mysql 开发EJB的配置(加入BMP,CMP开发实例)[推荐]
- · apache 2.0.48 + tomcat 5.0.16 配置说明
- · jive3.1.1的安裝
- · Tomcat4.1.x以上中类的加载
- · win2000下apache2+weblogic7实现基于同一个ip地址的多个虚拟主机访问多个weblogic站点
- · Apache2.0.47和Tomcat4.1.27整合过程
- · IBM WebSphere JSP源代码暴露漏洞
- · Tomcat IIS HowTo:将Tomcat装入IIS全攻略
- · CORBA例子(转)————————我也不知道是什麽东东:-)
- · Resin服务器平台介绍
- · Sun Java Web服务器远程可执行命令漏洞
- · Apache+Servlet+jsp
- · windows环境下安装tomcat <修订版本>
- · EJB概述(下)
- · 一份 tomcat vs resin 的测试报告。。。
- · EJB内部资参2
- · EJB内部资参5
- · 安装 JRun
- · j2ee doc 翻译系列之二 (2 完)
- · 将 Microsoft 的 Internet Information Server 用作 Java servlet 引擎 二 (给学过ASP的朋友)
- · 转:第一部分:EJB 体系结构的历史和目标
- · 准备翻译j2ee的doc,不知道有没有意义,请大家讨论。先贴一个:配置指南
- · J2EE技术
- · redhat6.1+apache+tomcat安装指南-jsp使用 (转)
- · WebSphere快速入门(20)
- · WebSphere快速入门(22)
- · WebSphere快速入门(2)
- · WebSphere快速入门(4)
- · WebSphere快速入门(6)
- · WebSphere快速入门(8)
- · WebSphere快速入门(9)
- · WebSphere快速入门(11)
- · WebSphere快速入门(12)
- · WebSphere快速入门(14)
- · 第一部分:EJB 体系结构的历史和目标 (二)(转)
- · 第三部分:布署和使用 Enterprise JavaBeans 组件(二)(转)

