-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
34 lines (30 loc) · 959 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using DecoratorDesignPatternExample.Core.Domain;
using System;
namespace DecoratorDesignPatternExample
{
/// <summary>
/// Decorator Design Pattern example.
/// </summary>
class Program
{
/// <summary>
/// Entry point into console application.
/// </summary>
static void Main()
{
// Create book
Book book = new Book("Worley", "Inside ASP.NET", 10);
book.Display();
// Create video
Video video = new Video("Spielberg", "Jaws", 23, 92);
video.Display();
// Make video borrowable, then borrow and display
Console.WriteLine("\nMaking video borrowable:");
Borrowable borrowvideo = new Borrowable(video);
borrowvideo.BorrowItem("Customer #1");
borrowvideo.BorrowItem("Customer #2");
borrowvideo.Display();
Console.ReadKey();
}
}
}