public void Main(bool b)
        {
            IDatabaseSaver databaseSaver = new DatabaseSaver();

            databaseSaver = new MailSenderDecorator(databaseSaver, new MailSender(), "email");
            databaseSaver = new CacheUpdaterDecorator(databaseSaver, new CacheUpdater());
            DoSmth(databaseSaver);
        }
Exemplo n.º 2
0
        public void Main(bool b)
        {
            IDatabaseSaver databaseSaver = new DatabaseSaver();
            var            sender        = new MailSender();

            databaseSaver = new MailSenderDecorator(databaseSaver, sender);
            databaseSaver = new MailSenderDecorator(databaseSaver, sender, "*****@*****.**");
            databaseSaver = new CacheUpdaterDecorator(databaseSaver, new CacheUpdater());

            DoSmth(databaseSaver);
        }