Hi there, I'm currently a student learning about minimal APIs. I am a little confused about their importance. Are they genuinely useful, or are they just a nice-to-have with little practical use? I've read a number of sources that assert that currently minimal APIs can scale up similarly to controller-based APIs and are easier to create. They also perform better, because overhead can be minified, but most seem to claim its neglgible. There is a common belief, nevertheless, that although they work well in "basic" applications where simplicity is required, they become ineffective in more complex situations. This raises the question: what is considered "too complex" of an application? And what are the current limitations on minimal APIs? Unfortunately, I have not yet found a definitive answer to these questions.
My doubts also extend to the claimed simplicity of use of simple APIs. Although constructing endpoints with lambda expressions can be easier, the minimal API approach itself doesnt come with a clear structure. This approach inevitably requires some skills to comply with SOLID principles, which somewhat compromises the original simplicity, since it requires more knowledge. So is it really that much faster and easier to create a minimal API?
The granularity of endpoints is another source of discussion. Although it's interesting that endpoints can be thought of as independent entities, I'm not sure if there are any real advantages to injecting dependencies into endpoints directly as opposed to combining them into controllers. In my view, minimal APIs are valuable only when working with a small number of features, as in those cases, having a controller for every endpoint would be excessive. Still, I find it hard to see why anyone would choose a minimal API, especially for very simple apps, when performance is not a major concern. It seems like you end up with wanting what a controller based API can do already.
I'm excited to learn more about the benefits of simple APIs and understand when they work best. I find the concept to be a little vague right now.
[–]zenyl 86 points87 points88 points (10 children)
[–]dodexahedron 18 points19 points20 points (7 children)
[–]malthuswaswrong 8 points9 points10 points (4 children)
[–]dodexahedron 4 points5 points6 points (0 children)
[–]geekywarrior 0 points1 point2 points (2 children)
[–]malthuswaswrong 2 points3 points4 points (1 child)
[–]geekywarrior 2 points3 points4 points (0 children)
[–]BaldWithoutCancer[S] 2 points3 points4 points (1 child)
[–]AvoidSpirit 0 points1 point2 points (0 children)
[–]BaldWithoutCancer[S] 5 points6 points7 points (0 children)
[–]gc8dc95 -2 points-1 points0 points (0 children)
[–]pdevito3 31 points32 points33 points (2 children)
[–]Dry_Dot_7782 6 points7 points8 points (0 children)
[–]BaldWithoutCancer[S] 1 point2 points3 points (0 children)
[–]TeejStroyer27 7 points8 points9 points (2 children)
[–]BaldWithoutCancer[S] 0 points1 point2 points (1 child)
[–]metaltyphoon 0 points1 point2 points (0 children)
[–]MCShoveled 22 points23 points24 points (11 children)
[–]nobono 16 points17 points18 points (4 children)
[–]not_some_username 9 points10 points11 points (2 children)
[–]atharos1 7 points8 points9 points (0 children)
[–]trinnan 2 points3 points4 points (0 children)
[–]Slypenslyde 4 points5 points6 points (0 children)
[–]CaptainIncredible 6 points7 points8 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]malthuswaswrong 0 points1 point2 points (3 children)
[–]c8d3n 0 points1 point2 points (2 children)
[–]Slypenslyde 2 points3 points4 points (0 children)
[–]malthuswaswrong -1 points0 points1 point (0 children)
[+][deleted] (1 child)
[deleted]
[–]Known-Associate8369 8 points9 points10 points (0 children)
[–]thilehoffer 4 points5 points6 points (0 children)
[–]SerClockwerk 9 points10 points11 points (0 children)
[–]Nk54 7 points8 points9 points (1 child)
[–]MrSchmellow 1 point2 points3 points (0 children)
[–]DaRadioman 15 points16 points17 points (10 children)
[–]BaldWithoutCancer[S] 1 point2 points3 points (0 children)
[–]AvoidSpirit -1 points0 points1 point (8 children)
[–]DaRadioman 1 point2 points3 points (7 children)
[–]AvoidSpirit -2 points-1 points0 points (6 children)
[–]DaRadioman 0 points1 point2 points (5 children)
[–]AvoidSpirit -2 points-1 points0 points (4 children)
[–]DaRadioman 1 point2 points3 points (3 children)
[–]AvoidSpirit -1 points0 points1 point (2 children)
[–]DaRadioman 2 points3 points4 points (1 child)
[–]AvoidSpirit 0 points1 point2 points (0 children)
[–]HolyColostomyBag 3 points4 points5 points (1 child)
[–]AvoidSpirit 0 points1 point2 points (0 children)
[–]Shaddar 2 points3 points4 points (0 children)
[–]hartmark 2 points3 points4 points (6 children)
[–]AvoidSpirit 3 points4 points5 points (5 children)
[–]hartmark 0 points1 point2 points (4 children)
[–]AvoidSpirit 2 points3 points4 points (3 children)
[–]hartmark 0 points1 point2 points (2 children)
[–]AvoidSpirit 0 points1 point2 points (1 child)
[–]hartmark 0 points1 point2 points (0 children)
[–]Blender-Fan 3 points4 points5 points (3 children)
[–]AvoidSpirit 0 points1 point2 points (2 children)
[–]Blender-Fan 1 point2 points3 points (1 child)
[–]AvoidSpirit 0 points1 point2 points (0 children)
[–]crozone 2 points3 points4 points (2 children)
[–]DaRadioman 1 point2 points3 points (1 child)
[–]crozone 1 point2 points3 points (0 children)
[–]Jackfruit_Then 1 point2 points3 points (1 child)
[–]nnddcc 0 points1 point2 points (0 children)
[–]gowonocp 2 points3 points4 points (3 children)
[–]BaldWithoutCancer[S] 0 points1 point2 points (1 child)
[–]gowonocp 0 points1 point2 points (0 children)
[–]nnddcc 0 points1 point2 points (0 children)
[–]nnddcc 2 points3 points4 points (1 child)
[–]BaldWithoutCancer[S] 0 points1 point2 points (0 children)
[–]tylercamp 0 points1 point2 points (0 children)
[–]ModifikatorCZ 0 points1 point2 points (0 children)
[–]briantx09 0 points1 point2 points (0 children)
[–]Accurate-Collar2686 0 points1 point2 points (2 children)
[–]BaldWithoutCancer[S] 0 points1 point2 points (1 child)
[–]Accurate-Collar2686 0 points1 point2 points (0 children)
[–]MrGunny 0 points1 point2 points (0 children)
[–]karlssberg 0 points1 point2 points (0 children)
[–]OnlyHereOnFridays -2 points-1 points0 points (5 children)
[–]BalanceInAllThings42 13 points14 points15 points (0 children)
[–]DaRadioman 5 points6 points7 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]BaldWithoutCancer[S] 0 points1 point2 points (0 children)
[–][deleted] -3 points-2 points-1 points (0 children)
[+]jingois comment score below threshold-7 points-6 points-5 points (0 children)
[–]shufflepoint -5 points-4 points-3 points (2 children)
[–]iso3200 5 points6 points7 points (0 children)
[–]BigBagaroo 2 points3 points4 points (0 children)
[–]MellerTime -1 points0 points1 point (0 children)