14 сентября 2023 г.
Просмотров: 104
Can we solve the usability problems of the humble update API?
At its heart an API must solve five core problems, affectionately known as CRUD plus querying. Your API allows developers to create, retrieve, update, and delete information — queries being a special type of retrieve action. Compared to the complexity of queries, the main CRUD methods are often considered trivial.
Are they, though? For a relational database, a single update can...
далее...
14 сентября 2023 г.
Просмотров: 68
Interfaces are at the heart of the “composition-over-inheritance” paradigm — let’s see what that means!
As you probably know, C# is a statically typed language. And as such, it is very helpful with type-checking and safe data conversions. Your IDE most likely knows when you’re feeding a variable of the wrong type somewhere and warns you, or even refuses to compile. However, you can actually take this flow checking one step...
далее...
11 сентября 2023 г.
Просмотров: 103
Introduction
In the realm of software development, the complexity of applications has steadily increased over time. To tackle this challenge, software architects have continuously evolved their approaches to designing and structuring backend systems.
In this article, we will delve into the evolution of backend software architecture, focusing on key paradigms such as N-Layered, Domain-Driven Design (DDD), Hexagon (Ports and Adapters), Onion, and Clean Architecture. Understanding these architectural styles and their distinctions can...
далее...
11 сентября 2023 г.
Просмотров: 95
In today’s rapidly evolving web development landscape, selecting the right framework is crucial for delivering efficient, scalable, and maintainable applications. React and Blazor are two leading frameworks that have gained significant attention in recent years. As developers and businesses weigh their options, understanding the differences between these two powerful tools becomes increasingly important. This article will delve into the strengths and weaknesses of both React and Blazor, comparing their performance,...
далее...
11 сентября 2023 г.
Просмотров: 99
When crafting elegant and scalable software in C#, a keen understanding of Dependency Injection (DI) is more than a luxury — it’s a necessity. It’s a design pattern that underpins many modern .NET applications, providing a solid foundation for managing dependencies between classes. In its most basic form, Dependency Injection promotes loose coupling, simplifying the maintenance and testing of applications.
This article will explore the best practices for Dependency Injection in...
далее...
10 сентября 2023 г.
Просмотров: 104
In a situation where we need to modify our API’s structure or functionality while ensuring that existing API clients remain unaffected, the solution is versioning.
We can designate our current APIs as the older version and introduce all intended changes in the next (or latest) version. This approach resolves two key issues:
1. Backward compatibility is maintained as the current APIs continue to coexist. This ensures that our clients won’t encounter any...
далее...
10 сентября 2023 г.
Просмотров: 78
MSSQL and MySQL are two of the most popular relational database management systems in the world
Nowadays, even when businesses are selling comparable products, rivalry between them is fairly widespread. In a market where there is competition, a company’s profitability is influenced by its ability to offer the finest services and goods and to attract the largest possible customer base for those items. The decision between MySQL and MSSQL Server is...
далее...
6 сентября 2023 г.
Просмотров: 283
To write files with C#, you have to know how to do it. The basics aren’t rocket science. There are a few lines of code you need to know. But writing and reading files with C# is something every beginning C# developer should be able to do.
If you want to know how you can read the contents of a file using C#, you can read the article Reading Files With...
далее...
5 сентября 2023 г.
Просмотров: 111
Simplifying Data Transport in C#.
In modern C# development, data transport objects (DTOs) play a crucial role in exchanging information between different layers of an application, such as between a client and a server, and traditionally, developers have used classes to define DTOs, which involves writing boilerplate code for properties, constructors, comparison methods, and string representations.
With the introduction of C# 9.0, a new and more efficient alternative has emerged: records.
In this...
далее...
18 августа 2023 г.
Просмотров: 162
C# Data Structures Handbook!
Every decision in programming is a silent influencer of performance and clarity. In C#, one such vital choice is selecting the right data structure.
Data structures are foundational pillars. These structures are where data lives, breathes, and interacts, determining the efficiency and readability of our code. But, as with all tools, they must be used judiciously. The beauty of C# is its rich repertoire of data structures, each...
далее...
17 августа 2023 г.
Просмотров: 170
What does your performance “stack” look like? There are all kinds of tools available for measuring page speed, but what data and assumptions do they use to measure performance? And speaking of measuring performance, there’s quite a difference between that and monitoring performance. Geoff Graham evaluates the data of different tools for measuring page speed performance and looks specifically at DebugBear, a commercial offering, that pulls together the best metrics...
далее...
15 августа 2023 г.
Просмотров: 148
Whether you have an app with just a few users or millions of users per day, like Agoda, improving the user experience by optimizing application performance is always crucial.
In the case of very high-traffic websites in the cloud, this optimization can translate into significant cost savings by reducing the number of required app instances. During Agoda’s transition from ASP.NET 4.7.2 to ASP.NET Core 3.1, our primary focus was on achieving...
далее...
26 июля 2023 г.
Просмотров: 233
Built with .NET 7.0, Dapper 2.0 and PostgreSQL
In this tutorial we'll show how to build a .NET 7.0 (ASP.NET Core) API with Dapper and PostgreSQL that supports CRUD operations.
Tutorial contents
Example API overview
Tools required to run the .NET 7.0 API
Run the CRUD example API locally
Test the API with Postman
Connect an Angular...
далее...
25 июля 2023 г.
Просмотров: 102
Web scraping is a technique that scrapes information from other online sources. This is a great way to combine different sources into one source. To create a web scraper you need a few things: online sources, some code that can access the internet, and a GUI. In this article, I am going to show you how web scraping using C# works.
Goals Of This Article
In this article, I will show you...
далее...
25 июля 2023 г.
Просмотров: 302
Unleashing the Power of Meta-Programming: A Comprehensive Guide to C# Reflection
Reflection, put simply, is a mechanism provided by the .NET framework that allows a running program to examine and manipulate itself. It’s like a coding mirror that gives your application the ability to look at its own structure, inspect its assemblies, types, and members, and even modify them-all at runtime.
The concept might seem abstract and complicated at first, but once...
далее...
25 июля 2023 г.
Просмотров: 158
Bending the Clean Architecture Principles
Async await meme
Introduction
Imagine you’re a chef in a kitchen full of ingredients, some fresh, some a bit past their prime, all thanks to Microsoft’s “We never throw anything away” policy. This is what programming asynchronously in C# is like — an overwhelming mix of new and old syntax all in one big pot.
This pot can turn to be a big ball of code mud, you could...
далее...
24 июля 2023 г.
Просмотров: 225
Small changes, Big wins: How little tweaks make your code easy on the eye
When we think of clean code, our brain jumps to SOLID principles, short classes, no comments, and good design patterns. While all of those apply, they are useless without the simplest thing of all: good naming.
I can spend 2 days writing a service that respects all SOLID principles, unit-testable, easy to change, but understood by nobody by...
далее...
24 июля 2023 г.
Просмотров: 164
We have been living in a distributed world for quite some time, and when considering how should you implement the communication between any two parties involved, the discussion seems to gravitate around two options: API or messaging.
Instead of focusing on the lost battle of which one is better, how about we focus instead on looking at their characteristics, what heuristics can we use to help our decision, and ultimately the...
далее...
23 июля 2023 г.
Просмотров: 466
Unlocking Resilience and Transient-fault-handling in Your C# Code
In an ideal world, every operation we execute, every API we call, and every database we query, would always work flawlessly. Unfortunately, we live in a world where network outages, server overloads, and unexpected exceptions are common realities. To maintain robust, resilient applications, we must anticipate these mishaps. Enter retry logic.
Hope for the best, prepare for the worst.
What is Retry Logic
Retry logic is...
далее...
23 июля 2023 г.
Просмотров: 254
I wrote a few articles about design patterns. A few examples are the Repository Pattern (or the generic version) and the Strategy Pattern. Both are very effective when writing software. But I have also mentioned SOLID, which is a collection of design principles. But what is the difference between design patterns and design principles? When do we talk about a design pattern and when about a design principle?
Design patterns and...
далее...