Create CRUD endpoints using Hyperlambda
In this article, I'll show you how to create CRUD endpoints, wrapping a database table, using Hyperlambda - And I'll walk you through it all in 1 minute
Join the DZone community and get the full member experience.Join For Free
Hyper implies web, and lambda implies function - Hence, Hyperlambda translates into "web functions", and this is a fairly accurate description. However, hyper also implies "super fast", and by super fast here, I mean super fast! 1 minute and 45 seconds was what I needed to create CRUD endpoints wrapping my database table, manually creating my endpoints in the following video, while explaining how I did it simultaneously.
According to modern studies in the subject, the number of lines of code your project consists of, is directly proportional to the amount of energy and resources you'll need to spend maintaining it. Hence, the fewer lines of code, the fewer resources are required to maintain it. In the video above, I copy and paste 50 lines of code, and I end up with 4 HTTP REST CRUD endpoints. Comparing this to C# is arguably unfair. Simply the boiler plate code for my Controller, would probably end up exceeding this number. You can find my code for all endpoints below.
Create - Filename actor.post.hl
Read - Filename actor.get.hl
Update - Filename actor.put.hl
Delete - Filename actor.delete.hl
It would be difficult to get more value than the above, regardless of which programming language you choose. If you want the explanation of how the code is tied together, and how it works, you can watch the video above where I walk you through every single aspect of the code. Of course, if you find even this too slow, you can let the computer automate everything for you, to the point where your computer will create somewhere between 180 and 300 CRUD HTTP REST endpoints per second - And afterwards create a frontend Angular project, with a complete GUI for your backend afterwards - Also in approximately 1 second.
Hyperlambda, because speed matters
Opinions expressed by DZone contributors are their own.