Design patterns are common coding practices defined to solve common software development problems.
The Singleton pattern was developed to provide a common way of providing a single instance of an object throughout the whole application lifetime. So, as long as the application is not restarted, this instance must be the same regardless of how many times you instantiate it.
Some examples of singletons are objects that need to share resources between classes or threads, like:
Sometimes, with poor implementation, the Singleton pattern can actually become an
anti-pattern , the reasons…
In a previous article, I showed how to create a production-ready build for a .NET Core application. In this one, I will walk you through on how to use Docker to create an image for development and another image for production for a ReactJS application.
Docker Windows requires Hyper-V to run and it is only shipped with the Pro version, so you are on a Windows that is not a Pro version you might have to use Docker Toolbox.
You might want to add this Docker extension that adds syntax highlighting and other features…
WebSockets is a technology that enables your server and your client to keep a connection open and send requests to each other. This is widely used when you need to keep your clients synchronized or to send messages or notifications to all your clients.
Microsoft developed SignalR, which is its technology for developing real-time applications, which are applications where the server can push information to the client instantly. SignalR also has support for the implementation of WebSockets.
Here I’m going to walk you through the creation of a simple real-time chat by having a .NET …
Entity Framework is a very powerful Object Relational Mapper (ORM). It facilitates so much the life of a developer when it is needed to handle information coming from a database, even more after the powerful feature Code First was released.
Even being easy to configure, sometimes we face some configurations that can be a little bit tricky to understand. This is the case when handling entity relationships — one-to-one, one-to-many, many-to-many.
I would say that some situations can get some developers confused, more frequent when dealing with many-to-many relationships. …
Today I’m writing about creating a production build for a .NET Core application using Docker. These are super exciting technologies and see many people wanting to learn more about how to use them together.
For those that don’t know, Docker allows you to easily create, deploy, and run applications. You pack your app and all its dependencies together and then ship into a docker image. Then you can run a container with this image in any machine running docker and be assured that your application will work fine, regardless of the machine’s configurations.
Exception handling is a really important part of an application. This provides us the capability of intercepting system errors, predictable or unpredictable so that we can take actions based on what happened.
Normally when dealing with code that can potentially throw an exception you involve it in a
try-catch block to catch exceptions that can be thrown and treat this exception in some required way and/or throw it again.
Here is an example of how you would do in a
The problem with using just this approach is that you’ll probably need to add…
Here I want to show you some of these similarities when working with arrays/lists in both languages.
LINQ queries, which is a built-in library, that make list manipulating a lot more fluent.
We all know…
Here I’m going to show you how to leverage from ASP.NET Core Identity to assist in management of users (Signup, Login, …) and how to secure your API by generating and validating JWT — JSON Web Tokens.
I had an issue while I was developing an application where I couldn’t find any information, articles or examples regarding how to make use of Identity with a multi-layer application, this led me to a lot of research to finally get on providing a good solution. Now I want to share this with you guys to help make your lives easier.
This is my first ever article written. I decided to write because I actually couldn’t find many articles explaining on how to separate your application in multiple layers. I hope you guys enjoy it. :)
Here we are building a nice API with basic CRUD (Create, Read, Update, Delete) operations. It will be an API for an app that stores which musics you like with its artists. We will call it MyMusic.
I will show you how to:
Full-stack developer and casual gamer