Posts

Design Pattern

Image
  1. What is the Singleton Pattern? The Singleton Design Pattern ensures that: Only one instance of a class exists in the application. There’s a global point of access to that instance. Think of it like a "VIP pass" – there’s only one copy, and everyone shares it. 2. Why use Singleton? Typical use cases: Configuration settings (database connections, etc.). Logging services (all parts of the application log through the same logger). Thread pool management . Caching and state management . The key idea is resource control – you don’t want multiple copies competing. 3. Basic Structure A typical singleton in C# has: Private constructor → prevents creating objects using new . Private static field → holds the single instance. Public static property/method → provides access to that instance. 4. A Simple Singleton Example Problem: Suppose in multithread environemnt, 2 threads at the same time tries to access the GetInstance() then, possibl...

Custom Azure DevOps pipeline task extension

Image
Pre-requisites/Dependencies 1.         Azure DevOps Organization with project 2.         Node.js (ver 10.x or higher) & NPM ·         Node.js is required to run the Azure DevOps CLI tools. Installing Node.js will also install NPM (Node Package Manager), which is used to install other dependencies. ·         Download:  Here (accept the default options in the setup wizard)   3.         TFX CLI (Azure DevOps Extension Tool) ·         TFX CLI is used to create, package, and publish Azure DevOps extensions. ·         Install via NPM (use any terminal): npm install -g tfx-cli 4.         Visual Studio Code ·         Visual Studi...