Category: Transparent façade

Project – BookStore – Structural Patterns-1

Context: We built a program in the past to support a bookstore. However, the store is going so well that our little program is not enough anymore. Our fictional company now owns multiple stores. They want to divide those stores into sections and manage book sets and single books. After a few minutes of gathering […]

Conclusion – Structural Patterns

The Decorator pattern is one of our toolbox’s simplest yet most powerful design patterns. It augments existing classes without modifying them. A decorator is an independent block of logic that we can use to create complex and granular object trees that fit our needs.We also explored the Scrutor open-source library to assist us in registering […]

Implementing the Decorator design pattern – Structural Patterns

Before you begin: Join our book community on Discord Give your feedback straight to the author himself and chat to other early readers on our Discord server (find the “architecting-aspnet-core-apps-3e” channel under EARLY ACCESS SUBSCRIPTION). https://packt.link/EarlyAccess This chapter explores four design patterns from the well-known Gang of Four (GoF). We use Structural patterns to build […]

Structured logging – Logging patterns

As stated at the beginning, structured logging can become very important and open opportunities. Querying a data structure is always more versatile than querying a single line of text. That is even more true if there is no clear guideline around logging, whether a line of text or a JSON-formatted data structure.To keep it simple, […]

Logging providers – Logging patterns

To give you an idea of the possible built-in logging providers, here is a list from the official documentation (see the Further reading section at the end of this chapter): The following is a list of third-party logging providers, also from the official documentation: Now, if you need any of those or your favorite logging […]

Log levels – Logging patterns

In the previous examples, we used the LogInformation method to log information messages, but there are other levels as well, shown in the following table: Level Method Description Production Trace LogTrace This is used to capture detailed information about the program, instrument execution speed, and debugging. You can also log sensitive information when using traces. […]

Writing logs – Logging patterns-2

In the Act phase, we call the Execute method of our service. This method logs a line to the ILogger implementation that is injected upon instantiation. Then, we assert that the line was written in the lines list (that’s what AssertableLogger does; it writes to a List<string>). In an ASP.NET Core application, all that logging […]



          Copyright © 2015-2024 | About | Terms of Service | Privacy Policy