Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IMessageWriter writer     = new SecureMessageWriter(writer: new ConsoleMessageWriter(), identity: GetIdentity());
            var            salutation = new Salutation(writer);

            salutation.Exclaim();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            /*
             * "notice that you wrap or decorate old ConsoleMessageWriter instance with new SecureMessageWriter class."
             */
            IMessageWriter writer     = new SecureMessageWriter(writer: new ConsoleMessageWriter(), identity: GetIdentity()); //<---- DECORATOR
            var            salutation = new Salutation(writer);

            salutation.Exclaim();
        }