sofa框架浅谈

浅谈支付宝所用框架sofa

sofa是支付宝的核心框架,目前开发环境框架已经升级到sofa3,sofa的核心是spring,测试这边的接口测试用着是ats核心是testng,ats为sofa服务者,下面大致讲下sofa框架的结构和特色!

sofa分:biz层即业务层,core层俗称核心层,web层即展现层,common层也称数据层,test测试层。业务层的biz-service发布服务,打成jar包的方式供其他facade调用,引用服务在调数据层,如附件图


每个模块有自己独立的spring上下文。
各模块spring上下文隔离。
模块之间的服务调用,通过向sofa容器注册/引用服务完成。

可以在sofa中发布一个内部服务
可以在跨bundle引用其他bundle的内部服务
可以发布一个外部服务(ws、tr)
可以引用外部系统发布的服务(ws、tr)
理解软负载和统一服务模型
将springbean发不成jvm类型的sofa服务


class="com.alipay.yanyu.core.service.user.impl.UserServiceImpl"
init-method="init"/>

interface="com.alipay.yanyu.core.service.user.UserService" />

其他地方引用服务

interface="com.alipay.yanyu.core.service.user.UserService" />


interface="com.alipay.yanyu.core.service.user.UserService" uniqueId="uniqueId1" />


interface="com.alipay.yanyu.core.service.user.UserService" uniqueId="uniqueId1" />


rpc服务发布
class="com.alipay.yanyu.biz.service.impl.UserFacadeImpl" />

interface="com.alipay.yanyu.common.service.facade.UserFacade" >




rpc服务引用
interface="com.alipay.yanyu.common.service.facade.UserFacade">



服务发布:
默认绑定:
跨JVM绑定:
服务引用:
职能声明一种绑定

不同bundle之间的引用和依赖通过pom.xml文件加入依赖
jar包引用

com.alipay.sofa.runtime
sofa-runtime-esb


log4j中配置日志相关内容

sofa的配置文件:
dbconf数据库配置文件(有几套环境可以选择)
sofaTestConfig文件配置接口以及系统间的调用(本地)
antx文件配置系统间的调用(服务器上)
pom.xml文件各种依赖的添加

你可能感兴趣的:(框架)