发表于: 2017-09-19 22:05:42
1 600
昨天完成的:
读原型图,DB设计
收获:
1.踩了个坑,加载多个xml不要用*,加载不了的
ClassPathXmlApplicationContext加载多个配置文件
ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"MultithreadTaskBeans.xml", "common.xml"});
Spring+junit整合测试加载多个配置文件
@ContextConfiguration(locations ={"classpath:spring-mybatis.xml","classpath:spring-service.xml","classpath:spring-aop.xml"} )
2.一、静态变量在类被加载的时候分配内存。
类在什么时候被加载?
当我们启动一个app的时候,系统会创建一个进程,此进程会加载一个Dalvik VM的实例,然后代码就运行在DVM之上,类的加载和卸载,垃圾回收等事情都由DVM负责。也就是说在进程启动的时候,类被加载,静态变量被分配内存。
二、静态变量在类被卸载的时候销毁。
类在什么时候被卸载?
在进程结束的时候。
3.AOP使用场景
AOP用来封装横切关注点,具体可以在下面的场景中使用:
Authentication 权限
Caching 缓存
Context passing 内容传递
Error handling 错误处理
Lazy loading 懒加载
Debugging 调试
logging, tracing, profiling and monitoring 记录跟踪 优化 校准
Performance optimization 性能优化
Persistence 持久化
Resource pooling 资源池
Synchronization 同步
Transactions 事务
计划:
完成数据库设计,准备写接口文档
评论