spring.net 继承

1.
  <object id="parent" type="Bll.Parent, HRABLL" >
    <property name="name" value="parent"/>
    <property name="age" value="1"/>
  </object>
  <object id="child" type="Bll.child, HRABLL" parent="parent" init-method="Initialize">
    <property name="name" value="override"/>
  </object>
2.
  public interface IPerson
    {
        void pr();
    }
    public  class Parent:IPerson
    {
        
        public void Initialize()
        {
            Console.WriteLine("init");
        }

        public void pr()
        {
            Console.WriteLine("parent");
        }

        public string name { get; set; }
        public int age { get; set; }
    }
    public class Child:IPerson
    {
        public void Initialize()
        {
            Console.WriteLine("init");
        }

        public void pr()
        {
            Console.WriteLine("child");
        }

        public  string name { get; set; }
       public int age { get; set; }
    }

 

posted on 2016-09-29 13:44  听哥哥的话  阅读(143)  评论(0编辑  收藏  举报

导航