-
Comments on Service Locator (Anti Pattern)
“In order to be what we are, we have to come out of what we’re not.” This is how one of the famous John Butler videos is starting. This is quite applicable in software engineering too and this is why it is important to learn about anti-patterns as well. Understanding anti-patterns helps developers identify problematic… Continue reading
-
RESP – Redis Client Server Protocol
Just like most of the RDBMS provide client server communication through mostly TCP, Redis also provides a similar protocol called Redis Serialisation Protocol (RESP). The following is a simple communication request and response on Redis server: Client: SET mykey “Hello”Server: +OK However the client doesn’t send the messages as it is, but the following RESP… Continue reading
-
Reflections on Clean Architecture Implementations with ORM
It has been a while since I started using and evangelising clean architecture concept for a lot of projects. I have witnessed they’re being successful. Customer maintenance teams happy continue to maintain them, less coupled, following TDD, etc. However, if I look back at the design documents of the very early projects I have done,… Continue reading
-
Startup Process Internals of Python Apps on Azure App Service for Linux
Microsoft documentation very well describes how to host a Python web app on Azure app service for Linux. In the documentation it says the essence of startup script to let the WSGI or ASGI based web server to serve the application. The startup command needs to be given in the startup command text box that… Continue reading
-
Power of Services: Decoupling Secrets for a More Flexible System Architecture
Services in Code Architecture Within the realm of Clean Architecture, a service denotes a module tasked with encapsulating business logic devoid of ties to the user interface, frameworks, or external entities like databases. In the Clean Architecture paradigm, services are meticulously crafted to house the fundamental application logic, ensuring its detachment from external intricacies and… Continue reading
-
Decoding the Clash: Navigating the Conflict Between Django LocMemCache and Uvicorn Workers
Django LocMemCache, short for Local Memory Cache, is a caching mechanism that stores data in the local memory of the server. Unlike more resource-intensive caching systems, LocMemCache is designed to be simple and efficient. It doesn’t require external dependencies or additional servers, making it an attractive option for projects with limited resources and reduced ops… Continue reading
-
Replace Conditionals with Polymorphism Requires At least One Conditional
One of the Martin Fowler recommendation and widely suggested by many people. I think there is a small confusion that a lot of people automatically try to become “anti-if” without realising this replacement at least require one conditional to choose the derived class. The below is the full example: Law of Demeter In my opinion… Continue reading
-
Django Logging Raw SQL Statements
I found the following code snippet is useful to print the raw SQL statements executed by Django ORM. Continue reading
-
Learnings From Game of Life
While working on the Conway’s Game of Life simulator in C#, to adhere OOD and SOLID principles, I had to think about how does the integer overflows would be handy to mimic the infiniteness of the Game of Life board. In a best and easy case scenario of the Game of Life, if cell (1,1)… Continue reading
-
Django: From Response Content to InMemoryUploadedFile
InMemoryUploadedFile is very common in Django which is often used in the context of handling file uploads from web forms. This type represents a file that has been uploaded by a user via a web form, but instead of being stored on the server’s filesystem, it’s kept in memory as a temporary file-like object. This… Continue reading
-
JSON Data Type on MySQL and PostgreSQL
Unlike SQL Server, both MySQL and PostgreSQL supports JSON data type, where as in SQL Server, we need to add the JSON content to NVARCHAR. The below is how we define a table with a column of JSON data type: The below is how we use UPDATE statement to update a JSON value column, in… Continue reading
-
On Web Servers Handling Multiple Requests
Disclaimer: I used AI tools to optimise the wordings of the following content. The traditional “forking” design relies on a master process that binds to a designated port, typically port 80, and actively listens for incoming connections. When a connection is established, the process triggers the “fork()” system call, leading to the creation of a… Continue reading
-
On Callable Units of a Program (aka “methods”)
Recently someone asked a question in a forum on C#, showing an implementation they found on book and another implementation they were able to come up with and asking if their implementation is wrong, even though their implementation too compile and run without any problem and give the exact same output as the implementation from… Continue reading
-
TDD and Type-safety
It is a common agreement that, dynamically typed languages execute type checking at runtime, whereas statically typed languages do it at build time. In that sense Python is a dynamically typed language. Recently there was a responsibility shift in my job role where now I need to write more Python code using Django framework than… Continue reading
-
DIP: Understanding the Levels
There is usually a confusion in understanding how to determine “low-level” modules while studying DIP (dependency inversion principle), the last one of the SOLID principles for object oriented design. High level modules should not depend upon low level modules. Both should depend upon abstractions. Robert C Martin Until I read the original article from Robert… Continue reading
-
LSP: Definition, Rules, Violations, and Implementation
This article was originally written to be published in ComSpective magazine. 11 Jul 2022 – Isham Introduction Behavioural subtyping is an object-oriented programming principle that subclasses should satisfy the expectations of clients accessing subclass objects through references of superclass type, not just in terms of syntactic safety (such as the absence of “method-not-found” errors), but… Continue reading
-
OData Responses in Camel-Case for Non-EDMs in ASP.NET Core
This could be a pretty specific issue and I don’t even guess that the 0.01% of the ASP.NET Core developer would come-across. However the title of the post is self-explanatory. The below is what needs to be added and this is for non-Newtonsoft.JSON cases as this uses System.Text.Json. This needs to be added/modified as below… Continue reading
-
JS Inspired C# Generator
JS Generators are pretty cool, however C# Iterators are sometimes boring. So I thought to implement two extension methods to mock the JS generator behaviour in C#. With this in place, the below code can be implemented. Due to the fact that the enumerator needs to be disposed, the using statement is used. Not sure… Continue reading
-
JWT Validation Middleware in ASP.NET Core
HTTP 440 ( Login Time-out) is a good and meaningful HTTP response code. Despite of that being unofficial and used only by a few Microsoft services – I found it very handy and meaningful to indicate if the JWT token is expired, rather than showing a 401 (Unauthorised) which is broad. In my opinion, HTTP… Continue reading
-
Convenience Methods, Golden Hammer and Boat Anchor
According to Wikipedia, Golden Hammer anti-pattern is a cognitive bias that involves an over-reliance on a familiar tool. Boat Anchor anti-pattern occurs due to developer’s belief or assumption that a piece of code is kept in the code base, assuming necessary in future (next week or next month), even though it is not mentioned in… Continue reading
-
Rewriting Counter Component as a Function Component
ASP.NET SPA template with React-Redux is a handy one if you want to quickly spin up a SPA application. But until today, even for .NET 5, the template comes with React class components. Since I personally believe JavaScript must not have classes, I rewrote those components to React function components. Here is how I rewrote… Continue reading
-
Low-Code / No-Code API – Part 11 – Azure API Management
Link to Part 10: https://programmium.wordpress.com/2020/09/27/low-code-no-code-api-part-10-azure-logic-apps/ Link to webinar: https://tiny.cc/nocode-azure ENCAPSULATION Even though “Encapsulation” is a term, which is mostly used in Object Oriented Programming, which means to restrict the direct access of some object’s components – it can be applied in other areas of software engineering too. In the case of low-code/no-code API development, we use… Continue reading
-
Low-Code / No-Code API – Part 10 – Azure Logic Apps
Link to Part 1: https://programmium.wordpress.com/2020/08/10/low-code-no-code-api-part-1-azure-sql-serverless/ Link to webinar: https://tiny.cc/nocode-azure HOSTING THE BUSINESS LOGIC In part 1, I have explained about the serverless persistent storage for the B2B API. In this part lets see how we’re going to use Azure Logic Apps as the platform to host the business logic in serverless manner using low-code/no-code approach,… Continue reading
-
Low-code / No-code API – Part 1: Azure SQL Serverless
Link to Part 0: https://programmium.wordpress.com/2020/07/21/developing-low-code-no-code-api-part-0/ Link to webinar: https://tiny.cc/nocode-azure Persistent Store – B2B API In the previous post, the high level architecture diagram showed that we’re going to use Azure SQL Serverless as the persistent storage (aka: the database) for the API. Azure SQL Serverless is relatively new offering form Azure SQL related products. This… Continue reading
-
Developing Low-code / No-code API – Part 0
Recently I conducted a webinar for Microsoft APAC on “Low-Code/ No-Code API Development with Azure Serverless” it is a technical deep dive. You can still watch this webinar here. Within almost an hour I managed to demonstrate the creation and development of a B2B REST API using Azure Serverless components without writing much code. In… Continue reading
-
ACI and Azure Front Door – Better Together
Azure Container Instances Azure Container Instances is a serverless offering using which you can quickly and easily spin up a container instance based on docker or ACR – Azure Container Registry. Even though ACI doesn’t feature a first class support to CI/CD, you shall still delete and create ACI instances so that whenever there is… Continue reading
-
Deploying Deno App on Azure Web App Service
Deno is a secure runtime for TypeScript and JavaScript. It was developed by the Ryan Dahl, the guy who developed Node.js. The idea behind Deno is to fix the design mistakes they did in the early Node.js development. Just like Node, Deno is build on Chrome V8 engine. Deno also comes with first class ES6,… Continue reading
-
Unit Testable Code Involving Azure Table Connection
Writing code that is testable is a good practice. In my very recent experience in a project involving TDD, I realized that writing unit tests ensures the code follows SOLID principles. With unit tests, you are enforced to decouple the components and make them highly cohesive. Even though testing integrations such as Database connections, File… Continue reading
-
SonarQube, Coverlet and .NET Core Code Analysis
Into to SonarQube Nobody overlooks code quality check-in 2020, there a quite a few tools to do it. SonarQube is one of the tools – generally, SonarQube is being used in team projects. Mostly the SonarQube configuration is taken care of the DevOps guy in the team. On the other hand, developers also can install… Continue reading
-
Simplify Large Scale Deployments with Azure Blueprints
Welcome to day 16 of the Azure Spring Clean ( https://azurespringclean.com/ )! Big thanks to Joe Carlyle (@wedoazure) and Thomas Thornton(@tamstar1234) for putting this learning initiative together! In this post, we are going to have a look at one of the latest offerings of Azure called Azure Blueprint. Azure Blueprint helps tom fully govern the… Continue reading
-
On Different Nuget Packages For Azure Table Data Access
As of today (5th Nov 2019) there are two Table data storage options available in Azure, Azure Table Storage Azure Cosmos DB (formerly Document DB) The intention for this post is only focusing on the different nuget packages available for these two offerings to access data. WindowsAzure.Storage The ancient one. This was used to access… Continue reading
-
MVC Builder Extensions in ASP.NET Core 3.0
Disclaimer: This post was drafted on 24th September 2019 and may not be relevant for the future .NET (core (do they still call it .NET Core) in future?)) versions due to the fact that the technology is very rapidly changing and maturing. IMvcBuilder interface is responsible for configuring MVC services in .NET Core. The service… Continue reading
-
Subscribing to All Events Types – Event Grid Topic
After 2019 June update to Azure Event Grids, you can no more see “Subscribe to all event types” when creating a new Subscription in an Azure Event Grid Topic. Even though it has been removed from Microsoft documentation, as of the time of writing this post, this reference still exists in Microsoft Cloud workshop Github… Continue reading
-
Azure App Service Easy Tables – How To Add After Missing “Data Connections”
“Easy Tables” is a handy feature for Azure Mobile Apps, which is a specialization of Azure App Service for creating mobile app backends. Apparently, Microsoft removed the “Date Connection” option under “Mobile” for App Service. Data Connection was the starting point to configure Easy Tables for Azure Mobile Apps. Without Data Connections, if you try… Continue reading
-
SharePoint : Getting Started with SharePoint Online REST
I was advised to learn SharePoint back in 2012 by my mentor due to the increasing job opportunities in SharePoint, but I didn’t really go for it, as I know that there were no much to code in SharePoint + hosting SharePoint was something I could not imagine. I gave up that idea and by… Continue reading
-
Confessions after Two Years of Development on Azure REST API
It has been almost two years since I moved from SDK based development on Azure to the REST API based development. It all stated after a discussion with a friend, who was going to be my future team mate while having lunch. He was explaining about the product they were working on and was asking… Continue reading
-
DESIGN PATTERNS FOR EXTENSIBILITY : DECORATOR PATTERN
In the previous post, I discussed about the need for “extensibility” and introduced “Strategy Pattern”. In this post, let me introduce you “Decorator Pattern” (aka Wrapper) and discuss it. Whenever I hear about word “Decoration” – Pakistani Trucks and Three-shaws come to my mind as they were decorated in every possible way. Unlike Strategy Pattern,… Continue reading
-
Design Patterns for Extensibility : Strategy Pattern
Technology is rapidly changing, thus the requirements are also changing expeditiously when it comes to software development. Adopting changes to the already written code is not an easy task. With the arrival of cloud and since there are so many options for the developers, the software needs to be expanded to fit the customer need… Continue reading
-
BSON : Introduction
BSON – Binary JSON gets my attentions lately when I was working on a messaging system implementation, where the main requirement was “optimal performance”. What is BSON BSON is designed to be efficient in space, but in some cases is not much more efficient than JSON. In some cases BSON uses even more space than… Continue reading
-
C# : Pattern Matching vs Performance
Pattern Matching was a hot thing when it was introduced in C# 7.0. It has been really useful and provided a expressive manner when programming. But what about the performance of Pattern Matching? I am discussing about it in this post. I took pattern matching switch statements for the post, so this is a valid… Continue reading
-
Azure : Function Apps via REST API, Deploy with App Service Plan and Consumption Plan
REST API documentation for Azure Functions is one of the poorest documentation I have ever seen. I thought to share a trick I have found in Azure Function REST API. Azure Functions do support both App Service Plan and Consumption plan. Both of them are there for different purposes. App Service Plan does support hybrid… Continue reading
-
Azure : App Service and Functions on HTTP/2
HTTP/2 was proposed in December 2014 and approved as a standard in February 2015, since then most browsers quickly added the support for HTTP/2. It was the first new version of HTTP since HTTP 1.1 which was released in 1997. HTTP/2 changes do not require any changes to how existing web applications work, but new applications… Continue reading
-
Azure : A General Service Bus Queue Message Serialization Issue and Solution
Most of the times we do work with Enterprise systems, and take Azure Service Bus as a candidate mediator between messaging systems. You might have come across a problem if you have worked with messaging systems that provide MQTT/AMQP messages, whilst the REST API of the Service Bus is wrapped in Node JS which runs… Continue reading
-
C# : OWIN – Environment Elements and Another Way of Information Passing
Earlier this week I ended up in a situation where, a signal flag wanted to be set in a controller method which will eventually invoke the RedirectToIdentityProvider notification where the signal flag value has to be checked and retrieved. Usually the RedirectToIdentityProvider notification is getting called when SignIn(), SignOut() or Challange() methods are getting called. I was… Continue reading
-
C# : Enabling C# 7.1 on Visual Studio 2015 / 2013
The C# compiler supports C# 7.1 starting with Visual Studio 2017 version 15.3, or the .NET Core SDK 2.0. This is what Microsoft says in their documentations. But still if you kind of not really willing to go to Visual Studio 2017 and using Visual Studio 2015 or even 2013, its not a big deal… Continue reading
-
Windows : Killing a Process Running on a Port
Its a common problem and its been increasing with the introduction and heavy dosage of .NET Core. So These are the three simple steps to kill a process running on a port. 1) Run CMD as administrator. 2) netstat -aon |find /i “listening” |find “8080” – This will show the process id thats is running on… Continue reading
-
ng : Add Angular CLI to .NET Core Angular template
As I have already written about, .NET Core 2.0 comes with SPA templates (Angular and React), in that post I demonstrated how to add a new ng component to the Angular app, created from the angular SPA template. In this post, lets see how to add Angular CLI support to the app, created out of the… Continue reading
-
Realm Object Server on Linode – Quick and Easy Setup
Intro The beauty in Realm is, its totally free if its hosted in your web server. Even though Azure supports Realm machines, where you can create a Realm Object Server in few clicks on Azure. But the least price is higher than 15 USD/mo. So Linode is a wise choice. Linode offers 1GB – 20GB… Continue reading
Recent Posts
- Comments on Service Locator (Anti Pattern)
- RESP – Redis Client Server Protocol
- Reflections on Clean Architecture Implementations with ORM
- Startup Process Internals of Python Apps on Azure App Service for Linux
- Power of Services: Decoupling Secrets for a More Flexible System Architecture
- Decoding the Clash: Navigating the Conflict Between Django LocMemCache and Uvicorn Workers
- Replace Conditionals with Polymorphism Requires At least One Conditional
- Django Logging Raw SQL Statements
- Learnings From Game of Life
- Django: From Response Content to InMemoryUploadedFile
- JSON Data Type on MySQL and PostgreSQL
- On Web Servers Handling Multiple Requests
- On Callable Units of a Program (aka “methods”)
- TDD and Type-safety
- DIP: Understanding the Levels
- LSP: Definition, Rules, Violations, and Implementation
- OData Responses in Camel-Case for Non-EDMs in ASP.NET Core
- JS Inspired C# Generator
- JWT Validation Middleware in ASP.NET Core
- Convenience Methods, Golden Hammer and Boat Anchor