From 9f59ca3e456c620beb3729eee1ee494dce92bb82 Mon Sep 17 00:00:00 2001 From: Alex Hyett Date: Thu, 7 Sep 2023 13:41:04 +0100 Subject: [PATCH] Add interface shown in video --- Facade/BadLogger.cs | 2 +- Facade/IBadLogger.cs | 4 ++++ Facade/Logger.cs | 2 +- README.md | 6 +++++- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 Facade/IBadLogger.cs diff --git a/Facade/BadLogger.cs b/Facade/BadLogger.cs index 2cdfa06..bd89714 100644 --- a/Facade/BadLogger.cs +++ b/Facade/BadLogger.cs @@ -1,4 +1,4 @@ -public class BadLogger +public class BadLogger : IBadLogger { public void Log(string message, LogType logType, LogTarget target, Exception? ex) { diff --git a/Facade/IBadLogger.cs b/Facade/IBadLogger.cs new file mode 100644 index 0000000..477a4ec --- /dev/null +++ b/Facade/IBadLogger.cs @@ -0,0 +1,4 @@ +public interface IBadLogger +{ + void Log(string message, LogType logType, LogTarget target, Exception? ex); +} \ No newline at end of file diff --git a/Facade/Logger.cs b/Facade/Logger.cs index 816198a..ecb03d3 100644 --- a/Facade/Logger.cs +++ b/Facade/Logger.cs @@ -1,6 +1,6 @@ public class Logger : ILogger { - private readonly BadLogger _logger; + private readonly IBadLogger _logger; public Logger() { _logger = new BadLogger(); diff --git a/README.md b/README.md index ed579dd..28d93ec 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,8 @@ I came up with the following 5 Design Patterns: 2. [Decorator Pattern](Decorator) 3. [Observer Pattern](Observer) 4. [Singleton Pattern](Singleton) -5. [Facade Pattern](Facade) \ No newline at end of file +5. [Facade Pattern](Facade) + +To run them just `cd` into each folder and run `dotnet run`. + +Note: You will need the .Net Core SDK installed to run these. \ No newline at end of file