Goodbye controllers, hello Minimal APIs - Nick Chapsas - NDC London 2023

preview_player
Показать описание
Minimal APIs are the hottest .NET 6 feature and for good reason. They makes it extremely easy to create high performance and scalable APIs without having to deal with any boilerplate code.

In this session I will introduce you to the beautiful world of Minimal APIs. I will show you how easy it is to build an API using them, with just a few lines of code, compare it to the "old-fashioned" approach within .NET and explore what that means for the .NET ecosystem and community in general.

More of Nick Chapsas:
@nickchapsas

Check out our new channel:
NDC Clips:
@ndcclips

Check out more of our featured speakers and talks at
Рекомендации по теме
Комментарии
Автор

Very impressive talk! At the beginning, I was very skeptical, but Nick completely turned me around. I hope to see more from him in the future. Well worth a watch.

Flynnor
Автор

Great video. I liked the comparison to Fast API and Express, which have successfully scaled to huge projects over the last few years. The .NET community could learn a lot from these other huge high performance projects.

velvetsound
Автор

I am participating an a microservices project just starting out. I have been annoyed after learning controllers that I have to go away from it so I have been pushing this minimal API to the future abit. After watching this I will recommend the others in my team to have a look aswell. Thank you for a great talk and for the example given.

BruLLLo
Автор

This makes me appreciate Node/Express even more!

mistymornings
Автор

great presentation, after this talk, I am going to start pushing my higher management on the importance of moving towards minimal APIs.

krishnamurthymadaraboina
Автор

I have implemented this to my actual project and it is insanely beautiful

ilovepandaypoe
Автор

I dont know sometimes I tend to prefer Java way of making things explicit instead of hiding everything behind syntax sugar making it even less readable .

dmitrykim
Автор

Clean Architecture is surely not a panacea or a silver bullet. And it's easy to overdo, especially since the industry tends to overdo everything. At its core it's just some sane SRP considerations to apply on the higher levels of an application structure, e.g. it's good to have an interface layer (for example Rest API endpoints) well-separated from the application logic, and to create generalized interfaces for infrastructural services to serve as a boundary between external and internal concerns.

While it's not common to replace DB implementation, it's much more common to replace generic external services like ecommerce APIs, accounting services, etc., and if those bleed deeply into a properly sized business logic or domain, that alone can cause a world of pain.

IMO domain and application layer separation is usually not important.

And yes, controllers are pretty trash. 😄 But what's way more trash, and very commonly seen even in this day and age, is a mind-bogglingly horizontal application structure with proper 1990 style tech folders, like models, services, helpers, validation, etc. It develops into a special type of horrible spaghetti code every single time, but many devs still haven't learned the value of screaming architecture, feature folders, and vertical slicing.

(This last paragraph wasn't directed at the demo app shown btw. Obviously tech folders are fine for demos, since there is usually not enough 'meat' to derive or discriminate proper concepts that would drive the design of the application structure.)

leakyabstraction
Автор

I just finished watching a movie. 🙂. Its an amazing episode. duly enjoyed. Thank you.

quranthecompanion
Автор

Great presentation. I really like the comparison with Python and JavaScript

tareksalha
Автор

@nickchapsas I really appreciated that well made transformers meme

mattpickel
Автор

As some1 how learned coding for himself on a c64, it was a big struggle to get compilers on pc's. I was a struggle to use all the warez stuff. I felt in love with the linux community and the great work of linus torvald and all the contributers who made linux great. I loved gentoo linux, i loved arch linux later on. Now i have a new job and have to code in c# and i really love it. I love the language, i love how the languages evolves and i think it's time to forgive microsoft for the fight against linux and open source... which is a hard emotional thing for me, because i really hated microsoft balmer/gates for it.

kittel-dev
Автор

Where can I find the source code to follow the structure ?

VisaNavigators
Автор

This is cool for writing something that is literally just an API that only ever returns data and it certainly simplifies the development of those especially for new developers, but this isn't a replacement for MVC and other related patterns. You are not going to write something like an OAuth2 server with this where the same endpoint can sometimes return data, a view, redirect, etc. depending on the flow/client type. There is still routers and controllers, it is just hidden to you just like main in the program.cs, using statements, etc.. Also, DI and services being injected should already be available so you would just be referencing them, so no more memory being used, kind of the entire point of DI.

chadsteelman
Автор

I don't know man, seems like just smaller controllers to me with a different name.

rolandomedina
Автор

How much "way faster" are your single action controllers that you call "endpoints"?

Eirenarch
Автор

Im planning to learn C# and .NET. Would I be able to understand this video or do i need C# and .Net proficiency to understand this. I'm primarily a Node & React dev. Thank You

Av-fnwx
Автор

That was an informative and well structured lecture.
But most of all, it was an educational lecture on picking the head up from one's narrow work context, and watching the bigger picture of the community.
The last sentences were a masterpiece.
Besides, getting used to a paradigm is considered as a good practice only while keeping the mind open to examine the renewed and updated ones.

yoseffixler
Автор

I was in the middle of thinking "hmm that reminds me of NancyFx" and then..

abeare
Автор

And still doing the same: CRUD data. Next year something else than minimal API doing....the same.

anomalii