From the course: Java EE 8: Web Services

Why web services are developed - Java EE Tutorial

From the course: Java EE 8: Web Services

Start my 1-month free trial

Why web services are developed

- [Instructor] Okay, so you want to develop web services. Let's start by defining what web services are. A web service is software that's accessed using Internet or Internet technologies by other software or sometimes hardware. "And what will be the point of that?" you ask. The primary answer is functionality. The first reason you'd want to build a web service should be to allow other code, hardware or applications execute some functionality that you built into your own software. Let's say you built a function or a program that's able to send documents to a printer for printing. Call it the PrintPresser application. When other applications or functions need to be able to do the same thing as PrintPresser, they could duplicate that functionality. So we could have an Accounting Application, a Bookkeeping Application or a Document Viewer App independently connecting to the printer with their own custom code. Or they could just connect to the PrintPresser somehow and just reuse the PrintPresser functionality. Clearly the second option is the better of the two. In that case the PrintPresser will need to become a web service, so that anyone can connect to it and use the printing function. Another great reason why web services are a thing is flexibility. In an enterprise-grade application you certainly want to be composed functionality into focused bits, microservices. This way web services can be independently composed into different, powerful, value adding combinations to build all sorts of greater functionality. So the Accounting, Document Viewing and Bookkeeping Applications can themselves become individual microservices of an application. Let's say we just grouped the Accounting and Bookkeeping services into what we call an Efinance application. With all our functions broken down into individually accessible web APIs, we can compose them into different applications using different combinations of the same services to support different use cases. Because our functions are wrapped behind a web service layer, we can make changes to the core function without necessarily affecting the consumers of our web service or API. This is crucial in an enterprise where the need to offer customers different flavors of business value with speed and agility is highly prized. So our PrintPresser web service can be changed, modified to talk to different kinds of printers and we don't need to touch the Efinance application or the Accounting Microservice or the Bookkeeping Microservice. The vast majority of web services all speak the one universal language. No, not the language of love. I'm talking about HTTP, what powers the Web. Web services are language agnostic. PrintPresser function could be built in any program language, let's say Java. Itself could consume 10 different web services and other external resources and our Accounting Microservice built in C# and our Bookkeeping Microservice built in Python wouldn't have to care about any of the downstream changes because of the web service wrapping around the PrintPresser web service. And that friend, is the story of web services. Web services are all around us. Facebook, Amazon, Netflix are essentially literally hundreds of conglomerations of individual web services and web APIs. Next, let's get a helping of alphabet soup.

Contents