Articles

Inversion of Code – HTTP Lambda functions

Normally when we create an HTTP REST endpoint, we add code to our server endpoint, and assume the client provides the arguments to our code. What if we could reverse this responsibility, such that the client provides the code the server executes?

Among other things, this implies we can have one endpoint doing "everything". We wouldn’t need to create dozens of endpoints to expose our API, and we could get away with creating a single endpoint, that clients invokes, regardless of what they want to do. If the client wants to create a record in our database, read records from our database, or count records in our database is irrelevant – He’d still use the same endpoint for all of these tasks. In addition, the client could become much more creative in regards to how he interacts with our API, and do things we couldn’t even imagine as we created our API. The latter of course sums up the problem, which is that clients could inject malicious code into our server.

Source de l’article sur DZONE

Create CRUD endpoints using Hyperlambda

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.

Source de l’article sur DZONE

Eta-Expansion and Partially Applied Functions in Scala

This article is for Scala programmers who know at least these essential concepts: what a method is and how to define a function value (lambda). Here we’ll discuss the topic of eta-expansion and partially-applied functions, which are often loosely covered and piecemeal.

You can read this article over at the Rock the JVM blog in its original form or watch as video on YouTube or in the video below:

Source de l’article sur DZONE

Building a Serverless IoT Backend Integration

Having a lightweight protocol which delivers messages over low bandwidth or unreliable networks is the foundation for a system that can facilitate the transports of data in near real time.

MQTT is one such protocol which designed to overcome following limitations:

Source de l’article sur DZONE

Your First Java AWS Lambda [Video]

AWS Lambdas provide a convenient environment in which to run short-lived applications without having to worry about provisioning the underlying hardware or manage operating systems. In this post, we’ll look at a simple Java application that can run as a Lambda.

The source code for this application is available on GitHub.

Source de l’article sur DZONE

NoClassDefFoundError When Using Lambda Instead of Anonymous Class [Snippets]

It’s recommended to use Lambda instead of the anonymous class, but there are some pitfalls, such as the potential  NoClassDefFoundError.

In this post, I will explore this error and how to avoid it. I have two classes, RequiredObject and OptionalObject. The latter one is optional at runtime, and optional dependency is common especially for this framework.

Source de l’article sur DZONE