Apr 28, 2022
Table Of Content
- Top 6 Tips to optimize the performance of your .Net application
- 1. Avoid throwing exceptions
- 2. Minify your files
- 3. Avoid blocking calls
- 4. Cache your pages
- 5. Optimize custom code
- 6. Minimize large object allocation
- Bonus: Performance Optimization Tips
- Client-side improvement
- Wrapping Up
You can find a lot of evidence that shows that due to slow loading times and clunky interaction, customers drive elsewhere and leave...
Apr 28, 2022
Bending the Clean Architecture Principles
So you’re writing code using .NET, and you surely follow the Clean Architecture and its layered abstractions. Apparently and even though the concept was introduced long ago, this is getting very trendy now.
One of your arguments may be that you want your infrastructure to be entirely swappable, you want your application and core business logic to be independent from the database you are using right? The...
Apr 28, 2022
Day-to-day tips I use to develop APIs.
Every day we need to develop new APIs, whether at work or for study purposes, and some features can help us with the use of good practices in a simple way. And through this post, I want to show you some features that I use daily.
1. API Versioning
One of the challenges for those who build APIs is changing contracts that are already in use...
Apr 24, 2022
What is MediatR? Why do we need it? And How to use it?
Mediator Pattern - The mediator pattern ensures that objects do not interact directly instead of through a mediator. It reduces coupling between objects which makes it easy to maintain the code. Mediator pattern unified the service interfaces around a common design, one request in, one response out.
MediatR is a simple, unambitious mediator implementation in .NET.
Let’s now dive deeper...
Apr 24, 2022
A practice approach to creating stable software.
Don’t make your software unstable like a house of cards, solidify it.
There are five principles to follow when we write code with object-oriented programming to make it more readable and maintainable if we don’t want that our program becomes a clock bomb in our hands. These principles together compose the acronym SOLID which means respectively.
Single responsibility principle.
Apr 24, 2022
The security of .NET applications is necessary and knowing how to protect it is not always an easy task. As developers, we must be clear that an insecure application can be a serious problem: from modifying the operation of the application or stealing the source code, to exposing a company to legal liability.
Each developer, it is clear that he applies the security that he believes convenient for his applications and...
Apr 24, 2022
Let’s find out which one is better .Net 6 or .Net 5 and how .Net has changed the game of software development.
In the past, I have briefly talked about the Dot Net 6 framework that was released last year in Nov by Microsoft during the .Net Conf 2021.
As mentioned, the latest version of .net 6 unifies the other .net frameworks into a single .Net platform. The journey to the unification...
Apr 24, 2022
What Is Caching?
Caching is a performance optimization strategy and design consideration. Caching can significantly improve app performance by making infrequently changing (or expensive to retrieve) data more readily available.
To eliminate the need to send requests towards the API in many cases and also to send full responses in other cases.
Some Caching Benefits?
Reduction in network round trips by making infrequently changing (or expensive to retrieve) data...
Apr 16, 2022
Today, developers are paying more attention to mapping libraries than ever before, because modern architecture forces them to map object to object across layers. For example, in the past I prepared a repository for clean architecture in github. So it’s a template for visual studio, you can see it and get more information about modern architecture layers.
However, based on what I know most developers do the mapping by writing many...
Apr 16, 2022
Sometimes it’s the little things that count.
When .NET 6 dropped this November, a few top-line items grabbed all the attention. I’m talking about C# 10, hot reload, Blazor’s AOT compilation, and some serious inner loop performance improvements. All of them are worthy enhancements. But if you look beyond the marquee items, you’ll see that .NET 6 also includes a number of small but smart refinements. These are the conveniences that...
Apr 15, 2022
No code development is the future of software development. With no coding, you can build custom applications with little to no code.
No code platforms are secure and easy to use, making them an excellent option for employee-only applications. These tools are ideal for tasks, time tracking, and internal communications. Especially for startups without a budget to hire a developer, no code solutions make it easy to build apps that fit...
Mar 23, 2022
Why do we need lifecycle hooks?
Modern front-end frameworks move the application from state to state. Data fuels these updates. These technologies interact with the data which in turn transitions the state. With every state change, there are many specific moments where certain assets become available.
At one instance the template might be ready, in another data will have finished uploading. Coding for each instance requires a means of detection. Lifecycle hooks...
Mar 22, 2022
Probably, one of the most dreaded software development methodologies might make sense again for small companies in a operational perspective.
Ken Schwaber — the cofounder of Scrum and founder of Scrum.org — says Waterfall “literally ruined our profession.” “It made it so people were viewed as resources rather than valuable participants.” With so much planning done upfront, employees became a mere cog in the wheel.
The waterfall development model originated in the...
Feb 3, 2022
What if programming languages were stocks? And you had to make a portfolio to fetch good returns in 2022?
You probably have seen various surveys and analyses listing the most popular programming languages. Those cover the universe of programming languages, like the S&P 500 does for the stock market. What would be the best portfolio for you to be successful and outperform the rest?
Of course, it depends on the risk profile,...
Nov 30, 2021
Many programmers wonder whether they will still be hired as they enter their golden years.
If you are a programmer and have been working for more than a few years, I won’t be surprised if thoughts have gone through your head about whether you will still be hireable as you approach your forties and fifties.
Don’t worry, you are not alone. Traditionally, programming has been looked upon as an industry for young...
Nov 25, 2021
Today, we are going to cover uploading and downloading multiple files using ASP.Net Core 5.0 Web API by a simple process.
Note: This same technique works in .Net Core 3.1 and .Net Core 2.1 as well.
Begin with creating an empty web API project in visual studio and for target, framework choose .Net 5.0.
No external packages were used in this project.
Create a Services folder and inside that create one FileService class and...
Nov 22, 2021
Dispose and Finalize are two methods you often use to release resources occupied by your .NET and .NET Core applications running in the context of the CLR. Most importantly, if you have unmanaged resources in your application, you should release the resources occupied by such resources explicitly.
Due to the non-deterministic nature of finalization and because finalizers are costly in terms of performance, the Dispose method is used much more frequently...
Aug 26, 2021
What is .Net 5
.Net 5 is one of the major and latest releases of Microsoft’s .NET family. It comes with many exciting features compared to the previous released .Net core. The primary goal with the release of .Net 5 is to merge all future .Net development onto one unified platform. All of Microsoft’s different development environments, such as WPF, ASP. NET, Xamarin, etc. are all moving to .NET Core, which...
Aug 22, 2021
The following are a set of best practices for using the HttpClient object in .NET Core when communicating with web APIs. Note that probably not all practices would be recommended in all situations. There can always be good reasons to break from a certain practice.
This list is not supposed to be exhaustive and will probably be edited over time.
All code examples are in C#.
Manage HttpClient instances with HttpClientFactory
HttpClient implements IDisposable....
Aug 15, 2021
.NET has a large number of built in exceptions. However, there maybe times when none of the built exceptions seem adequate for your particular scenario and you will need to create your own custom (AKA “user defined”) exception.
This post focuses on a discussion of how to create custom exceptions in .NET. The different types of built in .NET exceptions, exception handling, throwing, and more general exception related best practices will...