zoukankan      html  css  js  c++  java
  • Naive Container 发布1.0版本


    二进制文件和源代码可以从这里下载到:
    http://naive.container.googlepages.com/home

    存在的意义:
    最简单原始的组件装配

    使用:
    public class Susan : ContainerBound
        {
            
    public void FallInLove()
            {
                Console.WriteLine(
    "Susan has fallen in love with " + Get<Boy>().Name);
            }
        }

    public class Lily : ContainerBound
        {
            
    public void Kiss()
            {
                Console.WriteLine(
    "Lily is kissing {0}", Get<Boy>().Name);
            }
        }

    public class Lucy : ContainerBound
        {
            
    public void Marry()
            {
                Console.WriteLine(
    "Lucy is marrying " + Get<Boy>().Name);
            }
        }

    配置:
    Containers.GetContainerInContext<object>().Put(new GenericBoy("Van"));

    Containers.GetContainerInContext
    <Lucy>().Put(new GenericBoy("Tom"));

    Containers.GetContainerInContext
    <Lily>().Put(new GenericBoy("Joy"));

    Containers.Close();

    更多请参见项目主页

  • 相关阅读:
    playbook的复用
    playbook 任务标签
    playbook handlers 触发器
    playbook循环语句
    playbook条件语句
    Ansible变量
    每日总结4.13
    每日总结4.12
    每日总结4.9
    每日总结4.8
  • 原文地址:https://www.cnblogs.com/taowen/p/732598.html
Copyright © 2011-2022 走看看