• ioc 实现


    Public Class Lawyer
    {
        private IInfoSend infoSend;
        public IInfoSend setInfoSend(IInfoSend infoSend)
        {
          this.infoSend=infoSend; 
        }
        public void sendMsg()
        {
          this.infoSend.sendMsg(this.entity);
        }
    }

    Public Interface IInfoSend
    {
        void sendMsg();
    }
     
    public class BJInfoSendImp implement IInfoSend
    {
        private Ithird third;
        public void setIthird(Ithird third)
        {
          this.third=third;
        }
     
        override void sendMsg()
        {
           
    third.doSomething();    }
    }
     
    void main()
    {
     
        BJInfoSendImp infosend=new BJInfoSendImp();
        Ithird  third=new Third();
        infosend.setIthird(third);
     
        Lawyer law=new Lawyer();
        law.setInfoSend(infosend);
        law.sendMsg();
    }
  • 相关阅读:
    jQuery中的表单验证
    使用jQuery操作DOM对象
    jQuery中的事件和动画
    jQuery的选择器
    divise
    Word History airplay
    a前缀
    con词根
    vert词根
    quest词根
  • 原文地址:https://www.cnblogs.com/sofia/p/3274808.html
Copyright © 2020-2023  润新知