Skip to Main Content
Design Patterns and Best Practices in Java
book

Design Patterns and Best Practices in Java

by Kamalmeet Singh, Adrian Ianculescu, Lucian-Paul Torje
June 2018
Intermediate to advanced content levelIntermediate to advanced
280 pages
7h 46m
English
Packt Publishing
Content preview from Design Patterns and Best Practices in Java

Serverless architecture with an example

If we have got your attention already, let's take a very simple example to bring the point home. We will try to create a simple greetings example, where the function as a service implementation will greet the user. We will use the AWS Lambda function for this example.

Let's create our class with an example greeting function:

/*** Class to implement simple hello world example**/public class LambdaMethodHandler implements RequestStreamHandler {  public void handleRequest(InputStream inputStream, OutputStream  outputStream, Context context) throws IOException   {    BufferedReader reader = new BufferedReader(new InputStreamReader    (inputStream));    JSONObject responseJson = new JSONObject(); String name = "Guest"; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Design Patterns for Java Developers

Practical Design Patterns for Java Developers

Miroslav Wengner
Java Design Patterns

Java Design Patterns

Vaskaran Sarcar

Publisher Resources

ISBN: 9781786463593Supplemental Content