Example of using the Bridge Pattern in C#. More...
Public Member Functions | |
void | Run () |
Executes the example for the Bridge Pattern in C#. | |
Private Member Functions | |
void | _Bridge_Exercise_Demonstrate_Logging (Logger logger, string loggerType) |
Helper function to show an example of writing to a logger. | |
Example of using the Bridge Pattern in C#.
The Bridge pattern is used to allow a program to offer multiple ways to perform logging without changing how the logging is used throughout the program.
In this exercise, note how the calls into the logger are the same regardless of the logger used.
Definition at line 20 of file Bridge_Exercise.cs.
|
inlineprivate |
Helper function to show an example of writing to a logger.
This is called for all types of loggers, showing how the Logger class hides the details of the underlying implementation.
logger | A Logger instance to log to |
loggerType | The type of the underlying implementation. |
Definition at line 30 of file Bridge_Exercise.cs.
References Logger.LogError(), Logger.LogInfo(), and Logger.LogTrace().
Referenced by Bridge_Exercise.Run().
|
inline |
Executes the example for the Bridge Pattern in C#.
Definition at line 42 of file Bridge_Exercise.cs.
References Bridge_Exercise._Bridge_Exercise_Demonstrate_Logging().
Referenced by Program.Run().