The factory pattern is a way to create objects without worrying about how that object is created or what is needed, which allows loose coupling. This means we can ask our factory object to provide us a specific object and the factory will deal with constructing it. Of course, we have to setup our factory to do the creation first!
Here’s an example: you want to hire a new developer to work at your company. Now we may know what skills we are looking for, but what about work benefits and background checks? This is where we would ask the company’s hiring manager to sort things out. …
Let me first just start off with this quote:
“Why does Windows come up and show me a loading bar? Be like Linux and just load; don’t waste resources on showing me a loading bar!” — Anonymous
I understand the concern about those resources, however if you turned an appliance on — be it a light switch or a microwave — you would expect something to happen. If you switched your light on and nothing was to happen, you’d think “What has broken? Why didn’t the light turn on?” …
Some times we are stuck in a situation where we want to use our old .Net Framework library in our new .Net Core/Standard library. This can be achieved in many different ways, but lets go about this by allowing our library to be built for multiple frameworks.
We first create ourselves a new .Net Core console application (you could choose a .Net Core/Standard library, but you will need to reference this project to test it out). Lets go and add a new class called MultiFrameworks and place this code inside.
public string Platform
return ".NET Framework";
return ".NET Standard";
return ".Net …