SCA概念与应用实践(2. SCA基本概念)

来源:互联网 发布:百度seo推广方案 编辑:程序博客网 时间:2024/04/29 16:07

2.        

SCA 概念

       首先简单介绍一下 SCA 中的一些概念定义。这里只是简述一下这些名词,后面会利用实际的例子来说明各个概念都具体是些什么东西。基本上 SCA 体现为两张图。虽然不完全,但这两张图体现了 SCA 大部分的概念。

    2_1

  图2_1

2_2

图2_2

 

Ø         Component ,它是业务功能开发中最基本的元素,通过对 component 的装配,来形成一个有意义的业务功能。在 component 中定义 service reference service 是这个 component 对外提供的服务, reference 是这个 component 使用的其他 component 提供的 service 。每个 component 要有一个实现( implementation ),在实现的代码里面是具体的业务逻辑,包括对外提供 service 的具体实现。

Ø         Service component 对外提供的服务

Ø         Reference component  对其他 service 的引用

Ø         Binding service reference 包含 0 到多个 binding Binding 是提供调用 service 的方式。比如 soap binding rmi binding 等等。一个 service 可以提供多个 binding ,也就是有多个途径来调用该 service 。如果 service 提供 rmi binding 那么其他的 component 就可以通过 rmi 的方式调用这个 service

Ø         Composite ,一个或多个 component 组成一个 composite Composite 也可以包含 composite 。一个 component 提供比较单一的功能,一个 composite 可以把多个 component 组合在一起。

Ø         Application ,最上一层的 composite ,我们称他为 application 。它也是一个 composite 。一个 application 将是有一定意义和功能的模块。 Application 可以发布到 SCA runtime 中运行。

Ø         Promote Service / promote Reference component 上的 service reference 可以提升到 composite 级别上。 Component server reference 只能在 component 之间互相调用和使用。把 service reference promote 之后,就可以在 composite 之间使用。比如一个 composite application 想要调用另外一个 application service 那么必须先把各自的 service reference promote composite application 层上。

Ø         Wire ,这个是用来连接 reference service Reference 是调用其他的 service ,那么具体调用哪个 service ,将有 wire 来定义。

Ø         Property 它可以定义在 component composite application 上。在 component 的实现中使用 property 。相当于在 component 的实现中定义变量,变量名就是 property name ,然后在实现之外定义变量的值,也就是 property 的值。

Ø         Domain ,描述一个完整的运行时配置,会包括一个或多个内部互联的 Node SCA 规范并没有定义 Domain 的大小和配置,所以一个 domain 是可以变化很大的。典型的, domain 代表由一个组织控制的业务功能区域。整个组织可以是一个 domain ,也可能每个业务部门是一个域。

Ø         Host / node sca 规范中没有定义这两个概念,但在 Tuscany 的实现中有这两个概念的使用。在后面讲如何 deploy application 时,说这两个东西。