Chapter 3. A Logging Library
In this chapter, we will try to create a logging library that will enable an application developer to log information to a media (file, network, or database) during program execution. This would be a critical library that the developer would be able to use for audit trail (domain pre-requisite) and code instrumentation (from a debugging and verification stand-point). We will design and implement this library from scratch, and make it available as an API to the end developer for consumption.
During the course of this chapter, as a reader, you will learn to leverage strategy pattern, factory method pattern, template pattern, singleton and prototype patterns to do the following:
- Writing data to a file stream
- Creating a simple Data Access Layer (DAL) using ADO.NET
- Writing data to an SQLite database
- Writing data to a network stream using the System.Net API
- Handling concurrency
- Threads