《Expert one-on-one J2EE design and development》学习笔记1——JavaEE常用架构设计

本文探讨了JavaEE开发中的非分布式和分布式架构设计,包括Web应用搭配业务组件接口、Web应用访问本地EJB、使用WebService和远程EJB的优缺点。在选择架构时,需根据需求平衡性能、复杂性、可扩展性和可维护性。
摘要由CSDN通过智能技术生成

JavaEE开发中程序架构设计不仅会影响程序性能、复杂性,同时还影响到程序的可扩展性和可维护性,目前业界有规范的JavaEE架构设计被奉为经典,下面将按照是否分布式进行介绍。

非分布式架构:

1.Web应用搭配业务组件接口架构:


经典三层架构:用户接口层、业务逻辑层和持久化层。

优点:

(1).架构简单,是最常用最简单的Web应用架构,但是如果涉及到事务或者多线程问题时,需要编写比较复杂代码,不如直接使用EJB简单。

(2).程序运行速度快,这种架构很少遇到EJB容器的速度开销问题。

(3).不会遇到因EJB调用而破坏面向对象设计原则问题。

(4).测试简单,如果设计的得到,业务逻辑层不需要依赖Web容器就可以测试。

(5).扩展性比较好,若Web应用是无状态的且非分布式的,不需要依赖EJB容器提供的集群支持。若Web应用是分布式的且有状态的,则可以利用Web容器对状态替换的支持。

缺点:

(1).这种架构只支持Web应用的客户端,不支持standalone的java客户端。

(2).整个应用程序运行在同一个java虚拟机中,虽然提高了性能,但是无法自由将应用程序模块分配到不同的物理服务器上。

(3).这种架构无法使用EJB容器对事务的支持,必须在应用程序中编写事务创建和管理的相关代码(Spring等第三方框架可以提供类似javaEE容器的声明式事务)。

(4).这种架构无法使用EJB容器对并发

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
 What is this book about? The results of using J2EE in practice are often disappointing: applications are often slow, unduly complex, and take too long to develop. Rod Johnson believes that the problem lies not in J2EE itself, but in that it is often used badly. Many J2EE publications advocate approaches that, while fine in theory, often fail in reality, or deliver no real business value. "Expert One-on-One: J2EE Design and Development" aims to demystify J2EE development. Using a practical focus, it shows how to use J2EE technologies to reduce, rather than increase, complexity. Rod draws on his experience of designing successful high-volume J2EE applications and salvaging failing projects, as well as intimate knowledge of the J2EE specifications, to offer a real-world, how-to guide on how you too can make J2EE work in practice. It will help you to solve common problems with J2EE and avoid the expensive mistakes often made in J2EE projects. It will guide you through the complexity of the J2EE services and APIs to enable you to build the simplest possible solution, on time and on budget. Rod takes a practical, pragmatic approach, questioning J2EE orthodoxy where it has failed to deliver results in practice and instead suggesting effective, proven approaches. What does this book cover? In this book, you will learn When to use a distributed architecture When and how to use EJB How to develop an efficient data access strategy How to design a clean and maintainable web interface How to design J2EE applications for performance Who is this book for? This book would be of value to most enterprise developers. Although some of the discussion (for example, on performance and scalability) would be most relevant to architects and lead developers, the practical focus would make it useful to anyone with some familiarity with J2EE. Because of the complete design-deployment coverage, a less advanced developer could work through the book along with a more introductory text, and successfully build and understand the sample application. This comprehensive coverage would also be useful to developers in smaller organisations, who might be called upon to fill several normally distinct roles. What is special about this book? Wondering what differentiates this book from others like it in the market? Take a look: It does not just discuss technology, but stress its practical application. The book is driven from the need to solve common tasks, rather than by the elements of J2EE. It discuss risks in J2EE development It takes the reader through the entire design, development and build process of a non-trivial application. This wouldn't be compressed into one or two chapters, like the Java Pet Store, but would be a realistic example comparable to the complexity of applications readers would need to build. At each point in the design, alternative choices would be discussed. This would be important both where there's a real problem with the obvious alternative, and where the obvious alternatives are perhaps equally valid. It emphasizes the use of OO design and design patterns in J2EE, without becoming a theoretical book ,高清文档 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值