Prairie.Code() Sessions tagged api

Beautiful SDK Design in Java for APIs

Abstract

Often times Java SDKs for APIs look more like the API they represent than idiomatic Java.

This talk examines how great SDKs are built using design patterns.

It covers: enforced separation of Java api and implementation, use of generics, a caching layer and hiding network traffic.

Description

The (now defunct) Stormpath SDK had a great design approach from its original author, Les Hazlewood.

It has an enforced separation of api and implementation. It does this by using the api module as a compile time dependency and the implementation module as a runtime dependency.

It has a DataStore interface that makes heavy use of generics to support CRUD operations for all objects represented in the API. The implementation hides the actual network traffic and includes rich support for retry with backoff and error handling. Developers only ever have to deal with the DataStore, POJOs and method calls to "interact" with the API.

It also has a rich, interface-based caching layer. The default implementation is robust and suitable for single-JVM environments. It's easy to drop in a distributed caching layer, such as Redis or Hazelcast.

All of this combined makes this one of the best designed SDKs in Java. In this talk, all these secrets are revealed against a completely different API: DigitalOcean's Droplet API. There's a few slides and lots of code, including some live-coding.

Speaker

Micah Silverman

Micah Silverman

Senior Developer Advocate, Okta

Baby Got Backend: To Server, Serverless or Headless CMS?

As Sir Mix-a-lot once said, “My API don’t want none unless you off-prem, hun.” Let’s take cloud-deployed code one step further and ask: Do we need to spin up a full server to create a REST API? This talk will be an interactive discussion around the joys of deploying backend code and new alternatives. We will start by looking at Heroku as an alternative to AWS and DigitalOcean for deploying backend code. Then we’ll dive into using backends as a service (BaaS) like Firebase and wrap up with a demo of headless CMS platforms like Contentful. Backend references will include NodeJS, .Net Core and Django. Demos of frontend clients will be in Vue and Angular.

Speaker

Michael Leners

Michael Leners

Software Consultant, Source Allies

Robust, Strongly Typed, Documented API’s using NestJS, TypeScript, and Swagger

This session will introduce developers to the tools and architectures necessary to easily develop powerful API’s built on NodeJS. All API development will be done using TypeScript and an open source framework called NestJS (in addition to some other very handy NPM modules).

Front-end developers interested in learning to create and manage their own back-end with minimal learning curve. The NestJS framework will feel very familiar to any developers currently using Angular and TypeScript for their client-side application development. It provides a server-side experience that is built to mirror the client-side architecture of Angular.

.NET back-end developers looking to broaden their expertise in a new strongly typed framework. The overall development ecosystem is built to allow for a rapid API development process.

Ultimately, any developer who’s curious about full stack development yet feels intimidated by learning multiple frameworks would all benefit from this session. Developers utilizing NestJS can leverage the same IDE they utilize for client-side development.

For this talk we will demonstrate how API’s are built on this platform and discuss tooling, development processes, deployment options/best practices, and then leave attendees with a large number of resources to leverage.

We will discuss:

• Project Setup and Tools • Swagger/OpenAPI • Security • Validation • Optimization/Caching • Performance • Deployment • Testing

All development will be demonstrated using JetBrain’s WebStorm IDE and, for purposes of demonstration, we will utilize MongoDB as a data store and Redis Cache.

Speaker

Kevin Grossnicklaus

Kevin Grossnicklaus

President, ArchitectNow