The Java API Web Service Cheap Seats
Where does it all start to get rocking with API Web Services?
The industry trends tells us that we must adapt to using more API type of strategies as it plays into the IoT (Internet of Things). It allows for a portable way of abstracting an IT function into a reusable tool with a bi-product of driving down future solution delivery cost.
Just imagine the conversation that the next time that favorite project manager of yours asks you how long it will take to build out an automated solution to warm up the CEO’s high priced fancy projector 1 minute upon office arrival within the parking deck…and you actually don’t laugh out loud this time.
My analogy for why API technology is important…It’s like you handing out the Halloween candy to kids yourself to ensure you have enough to give out rather than letting the kids take how much candy they think is needed and hog around the porch stairs. Next thing you know you’re turning your front porch lights off and explaining to your wife that some big kid dressed in a robbers outfit took all the candy then broke the flower pot walking away. Who Knew.
Why another interface? Limiting direct calls to platforms for data (the candy), cleaning up dirty network traffic (controlling trick-or-treaters), elastic to business environment changes (anticipation of greedy trick-or-treaters), and allowing for quick-to-market solution deliveries (200 versus 20 trick-or-treaters per Halloween).
Below is my helpful checklist for getting an environment built and running (DevOps) for establishing Java API Web Services while understanding the key technology areas that support the products needed for getting started. People will sometimes use more advanced product that cost money whereas using these products eliminate license cost while still having a great support base.
API | JSON | REST | HTTP
API – Application Programming Interface, a set of programming instructions and standards for accessing a Web-based software application or Web tool. A company releases its API to the public so that other software developers can design products that are powered by its service
REST – Representational State Transfer, an Architecture Style by decoupling architecture of API’s from Business Logic with a stateless uniform interface. RESTful systems typically, but not always, communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) which web browsers use to retrieve web pages and to send data to remote servers
HTTP – Hypertext Transfer Protocol, the most common protocol for communication of digital content. In the case of API’s, it allows us to Get (Retrieve a resource), POST (Create a resource), PUT (Update a resource), DELETE (Delete a resource)
Java | Eclipse | Maven | Tomcat | Jersey | Swagger
- You will need both the Java SDK and the Java Run-Time as a foundation for all the technology to work together as this contains the libraries and execution layers. As of April 2015, the JDK 7 will no longer provide updates however Oracle is in the process of migrating users from Java 7 to Java 8 through the auto update feature which took place after the January 2015 CPU release.
First, download and installations the two components for getting started.
We need something we can interact with to write code or drag and drop using some sort of IDE. Eclipse is a very common tool for Java developers, to build Java EE and Web applications, including a Java IDE, tools for Java EE, JPA, JSF, Mylyn, EGit and others.
Getting Started with Eclipse:
The Apache Maven is a tool that can be used for building and managing any Java-based project. This tool can be leveraged by Eclipse to store the developer projects.
Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time
Tomcat 9 will be needed to serving up content via HTTP within a browser. This can run locally on your PC or on a virtual server.
"Apache Tomcat™ is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies. It also is an open software developed by the ASF or Apache Software Foundation. Designed to broker the web-serving features of JavaServer Pages. Allows integration of servlets through Java Servlet technology."
"Developing RESTful Web services that seamlessly support exposing your data in a variety of representation media types and abstract away the low-level details of the client-server communication is not an easy task without a good toolkit. In order to simplify development of RESTful Web services and their clients in Java, a standard and portable JAX-RS API has been designed"
"Swagger is a simple yet powerful representation of your RESTful API. With the largest ecosystem of API tooling on the planet, thousands of developers are supporting Swagger in almost every modern programming language and deployment environment. With a Swagger-enabled API, you get interactive documentation, client SDK generation and discoverability"