Introduction Ensures a class has only one object and provides a global access point.This falls under the category of Creational Design pattern.There is lot of explanation around the internet which makes me confused and I feel difficult to understand it initially. I am writing this article to provide straight forward explanation which may helpful to developers who are in the same category. Static Class vs Singleton Design Pattern Static class is initialized when loaded first and it will be stored in stack.In simple words, static class is eagerly loaded which may cause performance issues.Since it is stored in stack , we can't dispose it or garbage collector doesn't have anything to deal with it.Simply only static methods or static constructors are allowed within it and constructor will be invoked only once when class is loaded.This can't be inherited or cloned and so extension of this class will be nightmare. Think about the situation from where you want single object
Introduction We are in the new world of microservices and cross-platform applications which will be supported for multiple platforms and multiple heterogeneous teams can work on the same application. I like ASP.NET Core by the way its groomed to support modern architecture and adhere to the software principles. I am a big fan of dot net and now I become the craziest fan after seeing the sophisticated facility by dot net core to support infrastructure level where we can easily perform vertical and horizontal scaling. It very important design aspect is to keep things simple and short and by the way, RESTFul applications are build and it is a powerful mantra for REST-based application and frameworks. Some times we need to overrule some principles and order to handle some situations. I would like to share my situation of handling HTTP long polling to resolve the ASP.Net core 2 mins issue. What is HTTP Long polling? In the RESTFul term, when a client asks for a query from the serv