コード例 #1
0
        public static void Main()
        {
            ILogger            logger       = new FileLogger();
            Repository         repository   = new Repository(logger);
            RepositoryConsumer consumer     = new RepositoryConsumer(repository);
            ISpamFilter        spamFilter   = new MySpamFilter(logger); // Logger je proslijeđen konstrukoru klase MySpamFilter
            EmailService       emailService = new CodeBlocks.EmailService(spamFilter, logger);

            Bootstrap.Configure();
        }
コード例 #2
0
 public void Run()
 {
     ILogger            logger     = new FileLogger();
     Repository         repository = new Repository(logger);
     RepositoryConsumer consumer   = new RepositoryConsumer(repository);
 }