Download presentation
Presentation is loading. Please wait.
1
——计算机信息处理技术 成都理工大学 苗放 2003年10月
软件构建体系结构 ——计算机信息处理技术 成都理工大学 苗放 年10月 TechEd 2002
2
内容: N层结构体系 Microsoft DNA J2EE结构 Microsoft .NET框架
Sun ONE的体系结构(JDS, JES) Session time: 75 minutes N-Tier Review 10 Architecture 10 Transactions on the Web 20 Queued Web Service Calls 20 Q/A 15 TechEd 2002
3
什么是N层结构
4
N层结构概述 表示服务层 业务服务层 数据服务层 绘制用户界面 处理用户输入 运行业务规则和逻辑 抽象表示数据存储
确保原子性、一致性、 隔离性、经久性 (ACID) Let’s begin with a quick review of N-Tier architectures. Most people think of 3 main tiers, Presentation, Business Services and Data Services. Each tier seeks to provide a clean separation of the internals from the interface that the tiers above it seek to use. As our world becomes more and more connected this is becoming even more important. Presentation services focus on the user experience. The interface could be anything from a phone to a web browser or a rich client. Each of these clients must be able to communicate to the business services tier to obtain data required for rendering the user interface and for taking action based on user requests. The Business service layer must be able to apply business rules and logic safely and securely. The Data services layer provides data to the business services layer and protects the data from catastrophic failures. Another key job of the data services layer is to abstract the specifics of the data store allowing the business services to transparently work with different data store providers. TechEd 2002
5
为什么使用N层结构 分层结构的系统易于演化 隔离下层修改对上层的影响 在不同的信任域执行业务逻辑 易于部署 扩展灵活
反例: Mainframe -> client/server 隔离下层修改对上层的影响 在不同的信任域执行业务逻辑 易于部署 在少数服务器上部署而不是所有客户端 扩展灵活
6
内容: N层结构体系 Microsoft DNA J2EE结构 Microsoft .NET框架 Sun ONE的体系结构
7
Windows DNA体系结构 (Distributed interNet Application Architecture)
The previous generation of n-tier architecture launched in 2000 was Windows DNA. Most of you are familiar with this because you have been building applications based on the Windows DNA model. TechEd 2002
8
Windows DNA体系结构 表示服务层 业务服务层 数据服务层 MFC (C++) / VB6表单 ASP COM+
ADO / ODBC / OLE DB SQL Server Session time: 75 minutes N-Tier Review 10 Architecture 10 Transactions on the Web 20 Queued Web Service Calls 20 Q/A 15 TechEd 2002
9
Windows DNA体系结构 Key Concepts
表示层——用户界面部分 主要是通过在客户端浏览器中运行HTML、DHTML、Scripting、JavaApplet和ActiveX、XML,以实现用户与应用逻辑处理结果的通信 在Internet应用环境中,表示层的工作由瘦型客户机来完成 事务逻辑层——负责处理表示层的应用请求,完成商务逻辑的计算任务,并将处理结果返回给用户 事务逻辑处理层是将原先置于客户端的事务逻辑分离出来,集中置于服务器部分,为所有用户共享 事务逻辑层是整个应用的核心部分,而组件对象模型COM/COM+则相当于心脏 事务逻辑层通过COM/COM+进行事务处理,并由IIS(Internet Information Server)和MTS(Microsoft Transaction Server)为各种应用组件提供完善的管理 Key Concepts Application requirements for Server based code are different More plumbing requirements that distract from providing application services Narrative Think of a developer who writes very good calendaring and scheduling program, but has spent an entire career programming for the single user desktop. The developer now moves the server. As more people use the calendaring and scheduling code, the developer has to write more and more “server plumbing”. For example, the developer’s team leader wants to run the calendaring code on a workgroup server. In addition to scheduling code, the developer has to write code for sharing data, managing connections, managing security, and managing context. The department manager sees the application, likes it a lot, and wants it deployed across the entire 200 person department. The developer has to add multi-threading code to scale beyond a user-per-process architecture. The division vice president sees the application, likes it a lot, and wants it deployed across the entire 2,000 person division. Since 2,000 concurrent users (for a real application) strains the performance capacity of most high-end SMP systems, including UNIX systems, the developer has to write code for running the application across several servers, balancing the load among them. The CEO sees the application, likes it a lot, and wants it deployed across the entire 10,000 person company. Most enterprises don’t have 10,000 users at a single site, so the application needs to run on multiple servers running across a wide area network (WAN). This requires the developer to write store-and-forward message queuing code to make sure that the application runs even when the WAN is down. As more and more users rely upon the inventory system, the cost of downtime becomes increasingly expensive. At some point along the way, the developer needs to add high availability code to the application. All of this plumbing code, represented by the arrows in the chart, has nothing to do with inventory management. It represents a tax on developers, the price they have to pay in order to run on scalable servers. TechEd 2002
10
Windows DNA体系结构 Key Concepts
数据服务层——为应用提供数据来源 和以上的两层体系结构不同,数据库不再和每个活动客户保持一个连接,而是若干个客户通过应用逻辑组件共享数据库的连接,从而减少了连接次数,提高了数据服务器的性能和安全性 可以根据需要选择Microsoft SQL Server、Oracle或任何与OLE DB或ODBC兼容的数据源 Key Concepts Application requirements for Server based code are different More plumbing requirements that distract from providing application services Narrative Think of a developer who writes very good calendaring and scheduling program, but has spent an entire career programming for the single user desktop. The developer now moves the server. As more people use the calendaring and scheduling code, the developer has to write more and more “server plumbing”. For example, the developer’s team leader wants to run the calendaring code on a workgroup server. In addition to scheduling code, the developer has to write code for sharing data, managing connections, managing security, and managing context. The department manager sees the application, likes it a lot, and wants it deployed across the entire 200 person department. The developer has to add multi-threading code to scale beyond a user-per-process architecture. The division vice president sees the application, likes it a lot, and wants it deployed across the entire 2,000 person division. Since 2,000 concurrent users (for a real application) strains the performance capacity of most high-end SMP systems, including UNIX systems, the developer has to write code for running the application across several servers, balancing the load among them. The CEO sees the application, likes it a lot, and wants it deployed across the entire 10,000 person company. Most enterprises don’t have 10,000 users at a single site, so the application needs to run on multiple servers running across a wide area network (WAN). This requires the developer to write store-and-forward message queuing code to make sure that the application runs even when the WAN is down. As more and more users rely upon the inventory system, the cost of downtime becomes increasingly expensive. At some point along the way, the developer needs to add high availability code to the application. All of this plumbing code, represented by the arrows in the chart, has nothing to do with inventory management. It represents a tax on developers, the price they have to pay in order to run on scalable servers. TechEd 2002
11
内容: N层结构体系 Microsoft DNA J2EE结构 Microsoft .NET框架 Sun ONE的体系结构
12
J2EE体系结构 Key Points The base services provided by COM+
Simplify server side development Allow you to meet demand Narrative There are 3 basic services that COM+ provides that are needed to make simplification of middle tier development a reality. All first introduced in MTS. First, COM+ provides the listener aspect, it intercepts the call for the component and creates any thread. It needs to pass on any information regarding who is calling. And as component A calls component B that information needs to be propagated along the call chain. Second is the concept of scalability. I need to have an environment that allows us to meet the growth needs of our system, to handle increasing user work (# of users = more transactions = more money). The basic law of scalable applications is scalable applications share. You can’t allocate a resource per user, and you can’t hog vital resources like connections to databases. COM+ provides the infrastructure for allowing pools of resources. Where the number of resources created equals the number that need to do work now. Lastly, Transactions. Transactions hold everything together in complex systems. Inside a database I create a transaction do my work, commit or rollback. Concepts to clarify: Composable components, declare the transaction, multiple systems. Note You may ask why do we need COM+ with IIS? IIS only provides thread pooling for you. COM+ provides all services and not everything is a Web Application. IIS integrates into COM+ to provide some of its services (transactional ASP pages, process isolation, etc) TechEd 2002
13
EJB结构体系 什么是EJB技术? Session time: 75 minutes N-Tier Review 10
Architecture 10 Transactions on the Web 20 Queued Web Service Calls 20 Q/A 15 TechEd 2002
14
J2EE的容器和组件
15
内容: N层结构体系 Microsoft DNA J2EE结构 Microsoft .NET框架 Sun ONE的体系结构
TechEd 2002
16
Microsoft.NET体系结构 Microsoft.NET是Microsoft公司推出的下一代互联网软件和服务战略,它“代表了一个集合、一个环境、一个可以作为平台支持下一代Internet的可编程结构” .NET的核心是Web Service技术
17
Microsoft.NET体系结构图 TechEd 2002
18
Microsoft.NET体系结构 .NET围绕Web Service技术提供: 支持Web Service的运行环境
19
内容: N层结构体系 Microsoft DNA J2EE结构 Microsoft .NET框架 Sun ONE的体系结构
20
Sun ONE的体系结构 Sun ONE 的核心目标是构造智能的Web Service系统。
Sun公司认为在互联网环境下,有效的开放智能Web服务基础设施的关键是一系列的服务部件。 为了便于发现和访问,这些服务部件必须在一个中央目录中进行注册,并使用基于标准的结构来表现语境方面的信息,同时它们必须是开放的。
21
Sun ONE的关键技术 XML标准与技术 XML模式系统、 XML信息传递系统、 XML安全系统 Java技术
J2EE、J2SE、J2ME 基础设施标准 HTTP、SSL、LDAP等
22
Sun ONE的体系结构图 TechEd 2002
23
讨论
Similar presentations