Easy ColdSpring in Model-Glue
来源:互联网 发布:微博mac版下载 编辑:程序博客网 时间:2024/05/20 09:43
from: http://clearsoftware.net
Dave Ross and Chris Scott are doing an _amazing_ job with the ColdSpring project. For those of you who aren't familiar with Spring, it's a Java framework that provides a number of services such as IoC (like ConfigBeans in Model-Glue), Aspect Oriented Programming, and ORM functionality amongst many things. Right now, ColdSpring is at 0.2.1 and provides IoC and Aspect Oriented functionality.
Summary for the impatient - how to use ColdSpring seamlessly Model-Glue in four steps:
ColdSpring is very nice, and Dave's done some nice work on Model-Glue integration that I decided to wrap into the framework itself, building some functionality into the Bleeding Edge Release of Model-Glue (svn://clearsoftware.net/clearsoftware.net/ModelGlue) that'll let you seamlessly use ColdSpring.
Just add the following line of code to your ModelGlue.xml file:
Then change the beanMappings setting to your ColdSpring .xml file:
Once that's done, if you do getModelGlue().getConfigBean(), instead of passing the filename of an XML file to get, just pass the ID of the ColdSpring bean to load.
If you get the latest M-G BER, you'll notice there's a modelgluesamples/coldspring app that shows it in action. The thing just _worked_ on the first try.
Credit goes to Dave - he basically wrote the code to do it all, I just used the pluggable part of Model-Glue 1.0 to make it go.
Note: There are things to think about when using ColdSpring as the native bean factory in Model-Glue. You won't be able to use existing ChiliBean beans unless you create the ChiliBean BeanFactory by hand, so it's not something to implement mid-project. However, it wouldn't be hard to move ChiliBean XML files into a ColdSpring XML doc.
- Get latest from the BER Subversion repo.
- Add <setting name="beanFactoryLoader" value="ModelGlue.Core.ColdSpringLoader" /> to your ModelGlue.xml
- Change the beanMappings setting to the path to your ColdSpring xml: <setting name="beanMappings" value="/modelgluesamples/coldspring/config/beans/AllBeans.xml" />
- Instead of GetModelGlue().GetConfigBean("myBeanFileName.xml"), use GetModelGlue.GetConfigBean("ColdSpringBeanId")
- Easy ColdSpring in Model-Glue
- Model-Glue:Flex框架快速入门
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(前言)
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(1)
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(2)
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(3)
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(4)
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(5)
- 学习Model-Glue框架的系列教程-Building your first Model-Glue Application中文理解通俗版(6)
- overwrite attribute in model
- Challenges in Lean model
- Data model in python
- Channel Model in 36.104
- Java Model in JDT
- Attention Model in NLP
- [PHP] Easy popup in Magento
- Singleton Service Model in HiveMind
- Threaded Service Model in HiveMind
- (转)DataGrid使用
- sniffer pro学习小记(更新ing)
- 关于如何学习JAVA的好文章
- 2003年终个人总结
- Mach-II Pet Market Article Available Online
- Easy ColdSpring in Model-Glue
- 转载:程序员文化难道只是一种奢望?
- 回来了
- 爆笑:程序员的喝酒文化
- 2006-2-2(年初五)
- 木马客户端与服务端隐蔽通讯解析
- 一个网友写的用VC6.0集成环境快速开发VxD
- Debug的使用
- Debug的使用