Achieve Server新型MVC开发框架

1.5 应用服务性能
1.5.1 测试设备
处理器 2.3 GHz Intel Core i5,内存 8 GB 1067 MHz DDR3,图形卡 Intel HD Graphics 3000 512 MB, 系统 OS X 10.8.5 (12F45)
1.5.2 启动耗时
Achieve Server start span time 5124
Spring MVC start span time 15900
1.5.3 Http性能
Spring MVC
Server Software: Achieve-Server(129URL) Spring MVC(9URL) Spring MVC(109URL)
       
cument Path: /achieve-dtyx/test/123 /roo-test/test/123 /roo-test/test/123
Document Length: 3 bytes 3 bytes 3 bytes
       
Time taken for tests: 0.204 seconds 0.363 seconds 0.998 seconds
Complete requests: 2000 2000 2000
Failed requests: 0 0 0
Write errors: 0 0 0
Total transferred: 518259 bytes 338676 bytes 339690 bytes
HTML transferred: 6003 bytes 6012 bytes 6030 bytes
Requests per second: 9818.84 #/sec 5516.47 #/sec 2003.46 #/sec
Time per request: 10.184 ms 18.128 ms 49.914 ms
Time per request: 0.102 [ms] 0.181 [ms] 0.499 [ms]
Transfer rate: 2484.72 [Kbytes/sec] 912.25 [Kbytes/sec] 332.30 [Kbytes/sec]
       
Connection Times (ms)
min,mean[+/-sd],media,max Connect:1,5,0.8,5,7 Connect:0,2,1.6,2,11 Connect:,0,2,2.3,2,38

Processing:2,5,0.9,5,10 Processing:1,16,9.9,13,54   Processing:2,47,28.4,39,224
Waiting:1,5,0.8,5,9 Waiting:1,14,9.2,12,52  Waiting:2,44,28.2,37,220
Total:4,10,1.4,10,15    Total:3,18,9.2,15,55    Total:4,49,28.2,42,225

       
Percentage of certain time (ms) 50% 10 50% 15 50% 42

  66%     10      66%     18      66%     47
  75%     10      75%     20      75%     55
  80%     11      80%     23      80%     72
  90%     11      90%     31      90%     92
  95%     12      95%     41      95%    100
  98%     13      98%     45      98%    125
  99%     14      99%     50      99%    134
 100%     15 (longest)   100%     55 (longest)   100%    225 (longest)

2.1创新内容:(分层次论述)
2.1.1 BASIS BEAN
IOC框架分为BASIS和BEAN层,IOC框架对象(Basis
)创建也是利用IOC本身,BASIS初始化完成的IOC对象在实现IOC初始化Bean对象。
2.1.2 BASE BEAN
Bean对象可添加base order和 environment属性,通过子父类关系和base order environment来实现Bean对象的重定义。
2.1.3 URL二分匹配算法
所有URL规则都可以分为三个部分,PREFIXPATTERNSUFFIX,其中prefix,suffix可以形成一个排排序的规则。所有进入的URL的可以通过二分法快速找到可以匹配的URL规则段。URL规则段逆向遍历直至PATTERN匹配成功或失败退出。
2.1.4 INPUT 输入层抽象
所有的输入数据都可以抽象成一个字符化的URL和关联的各种不同属性(Param,InputSteam,Head,Session,Cookie等),而Service对象的方法和参数正好可以实现这数据的对映。从而实现一个对象方法可以实现不同类型的输入请求。

2.3.1 Achieve Server、Spring Framework功能对比
框架/功能  achieve server spring frame
Configure √ √
SubFactory √ √
BeanFilter √ √
BasisBean √ ×
BaseBean √ ×
Static Inject √ ×
Aop √ √
Transcation √ √
Web MVC √ √
Socket MVC √ ×
Command MVC √ ×
Android √ ×

2.3.2 Configure
achieve server 支持 environment 选择载入和联合属性,例如
database.host=127.0.0.1:3306
database.host|TEST|PRODUCT=localhost:3306
name=test
name+=join(name = testjoin)
database.host.=join(name = testjoin)
database.host|= test2(name = [test,test2])
2.3.3 Aop定义,Spring需要proccess 实例化的对象(BeanObject)
, Achieve Server 只需要实现AopMethodDefine。即定义一个方法处理对象。
2.3.4 多种接入,Spring 目前只有MVC框架,支持HttpServletRequest请求,支持新的接入需要重新写Mapping和Adapter以及关联对象。Achieve Server,只需要在实现接入类型的InDispatcher对象,同时传入参数和最后结果处理,均可以定义自己的Proccessor或Resolver。
2.3.4 配置接入
2.3.4.1
Achieve Server 支持配置启动(也支持xml配置对象),Spring 必需要有applicationContext.xml。
2.3.4.2Web MVC配置(Tomcate web.xml)
Achieve Server配置

InDispath
com.absir.servlet.InDispathContext


InDispath


Spring MVC配置

contextConfigLocation
classpath
:META-INF/spring/applicationContext*.xml


org.springframework.web.context.ContextLoaderListener


appserv
org.springframework.web.servlet.DispatcherServlet

contextConfigLocation
WEB-INF/spring/webmvc-config.xml

1


appserv
/

2.3.5 入口配置
Achieve Server
@Server
public class Admin_entity extends AdminServer {

public void list(String entityName, Input input) {...

@Mapping(method = InMethod.POST)
public void list(String entityName, @Nullable @Binder JdbcPage jdbcPage, Input input) {...

Spring MVC

@Controller
@RequestMapping(“/entity”)
public class Admin_entity {
public void list(String entityName, Input input) {…

@RequestMapping(value = "/{entityname}", produces = "text/html")
public String list(@PathVariable("id") entityname, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {...

@RequestMapping(value = "/{entityname}", produces = "text/html")
public String list(@PathVariable("id") entityname, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {...

你可能感兴趣的:(spring,AOP,IOC,transaction,Validator,Binder)