承接上文 抽象对象和子对象 .net篇(环境为vs2012+Spring.Core.dll v1.31) public class parent { public string Name { get; set; } public int Age { get;set; } } public class chlid { public string Name { get; set; } public int Age { get; set; } } <object id="p" type…
承接上文 自定义对象行为 .net篇(环境为vs2012+Spring.Core.dll v1.31) public class lifeCycle : Spring.Objects.Factory.IInitializingObject, System.IDisposable, Spring.Objects.Factory.IObjectFactoryAware, Spring.Objects.Factory.IObjectNameAware { public Spring.Objects.F…
承接上文 IObjectPostProcessor(对象后处理器) 前提是实现接口的对象注册给当前容器 C#: 通过继承AbstractObjectFactory对象的AddObjectPostProcessor方法来添加 添加对象配置在xml中用IApplicationContext自动注册 java: 通过配置在Javabean的xml中用ApplicationContext自动注册 调用ConfigurableBeanFactory的addBeanPostProcessor方法 接口名称分…
承接上文 ObjectFactory与IFactoryObject的杂谈 .net篇(环境为vs2012+Spring.Core.dll v1.31) public class parent { public string Name { get; set; } public int Age { get; set; } } public class CustomFactory : Spring.Objects.Factory.IFactoryObject { public object GetOb…
承接上文 IObjectFactoryPostProcessor(工厂后处理器)) 前提是实现接口的对象注册给当前容器 直接继承的对象调用这个postProcessBeanFactory方法,参数为工厂 添加对象配置在xml中用IApplicationContext自动注册 接口名称分别为.net的Spring.Objects.Factory.Config.IObjectFactoryPostProcessor 与Java的org.springframework.beans.factory.co…
承接上文 自定义类型转换器 .net篇(环境为vs2012+Spring.Core.dll v1.31) public class CustomeConverter : TypeConverter{ public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType){ return true; } public override object ConvertFrom( ITypeDescrip…
承接上文 对象的各种实例化 .net篇(环境为vs2012+Spring.Core.dll) 修改原来的PersonDao对象为 public class PersonDao : IPersonDao{ public string name; private child chlid; public PersonDao(string Name){ this.name = Name; } public PersonDao(string Name,child Child){ this.name = N…
承接上文 引用其他对象或类型的成员 .net篇(环境为vs2012+Spring.Core.dll v1.31) public class Person { public string Name { get; set; } public static int Age { get; set; } public string sex; public static int Add(int x, int y){ return x + y; } public int Add(int x, int y,in…
承接上文 方法和事件 .net篇(环境为vs2012+Spring.Core.dll v1.31) public abstract class MethodDemo { protected abstract SingleMethod CreateMethodByAbstract(); public virtual SingleMethod CreateMethodByVireual() { return null; } public virtual String add(int x,int y)…
承接上文 对象的赋值(调用方式都一样不再阐述) .net篇(环境为vs2012+Spring.Core.dll v1.31) public class PropertyDemo{ public System.Collections.ArrayList PropertyList { get; set; } public System.Collections.Specialized.HybridDictionary PropertyDictionary { get; set; } public Sy…