1 / 103

SOA 的实现

SOA 的实现. 冯志勇 天津大学计算机学院 2008 年 10 月. 大纲. 编程模型 SCA (Service Component Architecture) 服务组件架构 SDO (Service Data Object) 服务数据对象 Use Case (Simplified Bigbank). 编程模型. 什么是 编程模型 ?. 建立和部署应用软件和解决方案的模式。 定义和代表应用软件的结构和运行. SOA 模型. 定义复杂应用的结构和运行 how to use services

Download Presentation

SOA 的实现

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SOA的实现 冯志勇 天津大学计算机学院 2008年10月

  2. 大纲 • 编程模型 • SCA (Service Component Architecture)服务组件架构 • SDO (Service Data Object)服务数据对象 • Use Case (Simplified Bigbank)

  3. 编程模型

  4. 什么是编程模型? • 建立和部署应用软件和解决方案的模式。 • 定义和代表应用软件的结构和运行

  5. SOA 模型 • 定义复杂应用的结构和运行 • how to use services • how to aggregate services together • 定义的关键要素 • how elements are created • how elements are linked together • how the solution is deployed

  6. SOA模型 • 来自基本服务概念的动力: “服务仅仅是一个抽象的概括了软件功能 .” “开发者通过聚合服务构建服务,使用服务和开发 解决方案.” “组成服务转变为综合的解决方案是一个关键的活动 ”

  7. SOA模型—概念视图

  8. SOA模型—元素

  9. Development • SDO - Service Data Object • Makes it easy to manage data exchange across services with heterogeneous data formats. • SCA Client & Implementation Model • Simplify implementation of business services by focusing on business logic not on infrastructure SOA模型—元素 Integration Governance • SCA Binding & Policy Model • Expose components as Services regardless of underlying technology Business Process Modeling & Management Simplified Composition and Implementation for Services and Data Interoperability across Heterogeneous Environments Assembly • SCA Assembly Model • Assemble heterogeneous components into service networks

  10. SOA模型中的SCA和SDO • SOA模型中服务组件体系结构SCA&服务数据对象SDO • 基于SOA模型构建解决方案的新技术 • 将SOA解决方案分解成合适的元素 • 简化面向服务的业务逻辑及其相关联的数据表示

  11. SOA模型中的SCA和SDO • 服务组件体系结构(SCA)是一个规范,它描述用于使用 SOA 构建应用程序和系统的模型。它可简化使用SOA进行的应用程序开发和实现工作。 • SCA可简化使用SOA构建的业务应用程序的创建和重用。 • SCA提供了构建粗粒度组件的机制,这些粗粒度组件由细粒度组件组装而成,因而容易被集成。 • SCA 将传统中间件编程从业务逻辑中分离出来,从而使程序员免受其复杂性的困扰 • 使用SCA • 使得开发人员集中精力编写业务逻辑,而不必将大量的时间花费在更为底层的技术实现

  12. SOA模型中的SCA和SDO • SDO—服务数据对象 • 可简化数据访问; • 可简化数据表示; • 提供一致和统一的方式来访问数据,而不管数据的物理访问方式。

  13. SOA模型中的SCA和SDO • 通过使用SDO: • 开发者从访问后端数据源的技术细节中解脱出来; • 编程者得益于静态和动态的API支持; • 也得益于非连接编程的支持

  14. SOA模型中的SCA和SDO • SCA&SDO可分开使用; • SCA&SDO可一起使用以提供强有力和灵活的SOA的解决途径; • 在SOA模型的实现中,业务组件可表示为SCA组件,组件之间使用的数据可表示为SDO对象

  15. SCA和SDO商业价值 • 实现应用的实现提供了灵活性。表现为:技术中性;可重用;合成;动态适应性 • 灵活性是soa编程模型最大的优点之一:从业务的角度来说,灵活性有下面几方面的含义 • 技术中立:与实现无关 • 重用:服务和业务过程的重用,用清楚地定义和松散的服务耦合 • 组合:通过sca中的服务装配,可以将服务组装在一起。 • 对变化的动态适用性:当业务人员提交一个业务流程变化后,不需要等待很长时间就可以得到程序实现

  16. SCA和SDO商业价值 • Improved Flexibility

  17. SCA和SDO商业价值 • 提高编程人员的生产效率 • 松散耦合的服务模型能够使soa的开发团队中的人员并行工作,互相之间具有一定的独立性 • 服务重用:重用不仅仅增加了服务业务的灵活性,同时也降低了开发soa应用的成本,提高了系统的开发效率。使用sca可以将一流资源和新建的组建用进行统一的建模。支持由低向上的应用开发方式。 • 同时自顶向下的开发:soa支持自顶向下的应用开发方式。组建可以在实现之前就可以进行装配,而组建的实现可以放在开发周期之后完成。 • 改进的组织管理:sca使用模型的概念。模型用来组织组建。 • 技术中立:sca和sdo提供了对复杂过程和复杂数据对象的抽象。隐藏了服务提供者和服务消费者之间的的复杂关联细节。

  18. J2EE Solution SCA Solution SCA和SDO商业价值 • Increased Programmer Productivity

  19. SOA的简单总结 • 有助于提高业务的敏捷性; • 将IT构建为组合应用; • 关注业务目标和业务过程; • 组合应用中粗粒度且松耦合服务

  20. SCA—服务组件架构

  21. SCA 概要 • SCA models the “A” in SOA -可重用服务组成的系统 • 基于服务的系统的一个编程模型,: • 构造construction • 装配assembly • 部署deployment • 异质性 • 元数据驱动 • 多语言 • 多容器技术

  22. What?... the “A” in SOA • 一套规范 • 描述了一个使用面向服务的体系结构建设应用程序和系统的模型 • 扩展和补充实施服务的已有办法 • 建立如Web服务的开放标准,

  23. What?... the “A” in SOA • SCA将建立SOA应用的过程分解成两个主要的部分 • 组件的实现 • 为外部提供服务 • 为外部提供服务 • 组件的组装 • 将服务引用与真实的服务连接起来,使用各组件之间建立真实而不是虚拟的程序调用与数据传递通道。

  24. What?... the “A” in SOA • SCA规范着重强调要将服务的实现和服务的组装与实现的细节进行解藕 • 与底层平台的细节解藕合 • 与如何调用服务的具体方式进行解藕合 • SCA组件 • 在“业务逻辑”层面是进行设计 • 使用最少的中间件API

  25. What?... the “A” in SOA

  26. What?... the “A” in SOA • 支持多种编程语言 • 面向对象和过程语言 • Java, PHP, C++, COBOL • 以XML为核心技术的语言 • BPEL and XSLT • 描述性语言 • SQL and XQuery

  27. What?... the “A” in SOA • SCA还支持多种程序设计风格 • 异步程序设计和面向消息的程序设计 • 同步程序设计,即调用——返回的程序设计风格 • 静态程序设计 • 动态程序设计 • 基于连接的 • 非连接的

  28. What?... the “A” in SOA • 同时支持多种服务调用方式 • Web services • Messaging systems • CORBA IIOP • 重点关注服务的申明,不依赖于服务的具体实现技术 • Bindings • Infrastructure capabilities

  29. Composition, Visualization and Management Assembly Model Client Model Operations Architectural Design Development SCA ESB QoS Container Security Transports Clustering Transactions Policy SCA Java Spring EJB Service Registry Routing SCA 和SOA 基础结构

  30. SCA家族说明 • 一系列文档, 即 • 组装模型 • linking of components through wiring • independent of implementation language • 客户端以及服务实现规范 • implementation of service components and of service clients • Java & C++ specifications • BEPL

  31. SCA家族说明 • 发布的SCA白皮书 • Changes in the SCA Assembly specification since the 0.9 release • The Recursive Assembly Model • WS-BPEL and SCA White Paper • EJB Integration White Paper • JAX-WS Services Integration • PHP and SCA White Paper • SCA Bindings for Web Services, JMS and EIS/JCA

  32. SCA家族说明 • SCA规范草案 • SCA Assembly Model V0.96 • SCA Client and Implementation Model for Java (V0.95) • SCA Client & Implementation for BPEL (V0.95)\ • SCA Client & Implementation for Spring (V0.95) • SCA Client & Implementation for C++ (V0.95) • SCA Policy Framework • SCA Web Service bindings • SCA JMS Binding • SCA EIS/JCA Bindings

  33. 开发者 和 支持者 • Developers • OSOA (Open SOA Collaboration) • http://www.osoa.org

  34. 开发者 和 支持者 • Supporters

  35. SCA vs. WS-* Specifications • 提供了一个统一的描述服务实现的模型 • 更容易组成服务网络 • 在组装时客户化服务实现 • 提供了一个业务逻辑层的服务实现模型 • 没有像JDBC,JCA,JMS…这样的技术API • 支持多种服务绑定方式,包括Web服务 • WSDL,SOAP • RMI,IIOP • Others • 定义了具体的数据转输格式和协议 • 互操作 • 独立于编程模型 • 需要将服务接口显式定义到WSDL文件中

  36. SCA vs. J2EE • Scenario 1: • Integrate 2 EJBs, 1 JavaBean, and two Web Services into a JSP based web application: With SCA • Developer wires EJB access, JavaBean, and Web Services together using a Visual Tool. • Developer uses one wiring editor for all components (developer does not need to use specific APIs) – no low level APIs at all • Loose Coupling: New components can be wired into existing applications easily • No additional coding needed to invoke a component asynchronously • Structure of the solution captured in assembly model Without SCA • Developer hardcodes EJB access, JavaBean, and Web Service invocation in their web application • Specific low-level APIs must be used for each technology (EJB, JavaBean, Web Service) • Tight Coupling: Additional coding required to replace one EJB with another EJB • If one component needs to be invoked asynchronously, low level coding is necessary • Structure of the composite application is hard to visualize

  37. SCA vs. J2EE • Scenario 2: • Integrate 1 Rule, 1 Web Service, 1 EJB, and 1 CICS Transaction into a BPEL Business Process: Without SCA • Developer uses wizards to generate WSDL for each component • Tight Coupling: Business process must be modified if a service is replaced by another service • If one component needs to be invoked asynchronously, a complex set of steps are required to build an asynchronous service. • Integration Developer = Highly skilled component developer With SCA • Developer assembles components developed by other developers or creates business components using Wizards/Tools. The assembler doesn’t care how each component is implemented • Loose Coupling: Business process does not need to be modified if a new service replaces another service (the new service is simply rewired into the application) • Simple to invoke a component asynchronously • Integration Developer = A developer who can build a composite application without low-level component development Skills

  38. Roles/Tools/Runtime SCA Roles Uses Tasks Runtime uses this tool… This Person... …and deploys it to this runtime to perform this task … … to build this type of application Task: Build/Assemble J2EE Components Java Application Developer Tools Application Server (w/SCA) POJO JSF1 EJB1 Web Service Web Container EJB Container Service Component Developer SCA Composite Task: Build/Assemble Business Processes Process Server State Machine I/F or BO Transform Business Process Business Rule Adapter Process & Integration Developer Tools Process Container SCA Composite Task: Build Mediations ESB / Connection Server Integration Developer Mediation 1 Mediation 2 Mediation Container SCA Composite = SCA Component

  39. SCA 应用程序架构

  40. 基于SCA的服务组合 SCA components may be implemented using a variety of technologies including POJOs, BPEL, Spring Beans, EJBs, etc. System Composite A Composite C Refe- rence Service A SDO Service Component A Component B Refe- rence SDO Composite B Component C Component D Service Refe- rence Service B Services are assembled and “wired” together. SCA allows wiring to be done using a diverse bindings such as WS-* and JMS • Flexible, powerful service construction • Flexible, powerful assembly • Flexible, powerful binding

  41. 服务装配模型 • Contents: • Assembly Model • Introduction, Overview, Composite, System, Binding, Extension Model • Appendix 1: • Packaging and Deployment, XML Schemas, UML Model, SCA Concepts • Appendix 2: • Policy, Security, Transactions, Reliable Messaging

  42. 服务装配模型 • provides: • 提供一个统一的、语言无关的服务提供机制 • Java and C++ available now • BPEL and interpretive languages (e.g. XSLT, XQuery) • other languages via extensibility (including .NET) • 提供一个与底层技术无关的服务网络建模与组合机制 • Service dependencies • Resolution through wiring • 提供服务动态配置与管理的机制 • Properties • Protocols • Qualities of service

  43. 装配模型概述 • Diagrams used to Represent SCA Artifacts

  44. 服务组合的具体规范 • 一个SCA的组合是一系列SCA组件的逻辑聚合。 • 一个组合可以包含一个或多个服务组件、服务、引用或连接。 • 一个组合还被赋予一系列属性,通过配置这些属性,可以实现对组合内部组件的配置。 • 从更高的逻辑层次进行SCA系统建模时,一个组合还可以被看作是一个服务组件的实现。

  45. 服务组合的具体规范 • 可以通过定义“Include”来实现对现有服务组合的复用 • SCA服务组合是一个部署的基本单元 • 部署时,一个服务组合存储成一个以.composite为扩展名的文本文件,文件遵循XML规范 • 一个服务组合在XML中使用一个<composite>节点来表示, .composite文件的格式在SCA规范中作了详细描述

  46. A sample

  47. 服务组合的具体规范 • 一个.composite文件中,”composite”节点必须具有一个“name”属性,属性的值为该服务组合的名字 • “composite”节点中可以有0个或多个 • “service”节点 • ”component”节点 • “reference”节点 • ”wire”节点, • 还可以包含0个或多个”include”节点。分别表示该组合使用了0个或多个服务实例,组件,引用,连接或现有服务组合的复用。

  48. 服务组合的具体规范 • component Components are configured instances of implementations. Components provide and consume services. Components are defined as subelements of a composite in an xxx.composite file.

More Related