You’ve got along ASP.NET project ahead. You’re trying to wrap your head around all tasks at hand - infrastructure, business logic, admin panel, integrations. On top of that, there’s a long list of ‘could have’ type of features that the team would like to implement if time and resources allow.
One of them is adding the ability to send email in ASP.NET C# that you’ve been postponing for a while. After all, it’s such an obvious feature that might as well be left for the very end, when almost everything is up and running. Before your project goes live, you will need to validate your email workflows anyway and probably you don’t want to stay extra hours just before the launch to do so.
While sending emails with C# is not rocket science, we strongly recommend thinking about it sooner rather than later. To make it easier to start, we’ve covered the first steps with the various code samples. Let’s start!
What Is Strategy Pattern C# ?
The Strategy pattern in C# lets the algorithm vary independently from clients that use it.
There may be different algorithms (strategies) that apply to a given problem. If the algorithms are all kept in the client, messy code with lots of conditional statements will result.
Strategy pattern defines a family of algorithms, encapsulate each one, and make them interchangeable.
The Strategy pattern enables a client to choose which algorithm to use from a family of algorithms and gives it a simple way to access it.
The Mediator pattern in C# enables objects to communicate, without knowing each other’s identities. It also encapsulates a protocol that objects can follow.
You can think of a Mediator object as a kind of a coordinator; that handles traffic between appropriate parties based on its own logic.
Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
What is Observer Pattern?
Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
In this pattern, there are many observers (objects) that are observing a particular subject (also an object). Observers want to be notified when there is a change made inside
the subject. So, they register themselves for that subject. When they lose interest in the
subject, they simply unregister from the subject.