zainabed.com is collection of programming tutorials, created & maintained by Zainul Abedin Shaikh. These tutorials are predominantly focused on Programming Technology like Java, Java Web,Spring MVC, AngularJs,Elasticsearch, Android, JQuery, Web Design, Mongodb, PHP and MySQL.
JAX-RS is API specificationfor RESTful web services
using Java. RESTful web services is implementation of REST (Representational State Transfer) which is architectural design for
distributed system or in general we can say JAX-RS is a set of APIs to develop REST service.
This is a brief introduction about REST and JAX-RS. You can
find more information on REST on Wiki and JAX-RS Official Site.
What is REST?
Representational state transfer is an abstraction of the architecture of the World Wide Web. More precisely, REST is an architectural style consisting of a coordinated set of architectural constraints (source Wikipedia) As JAX-RS is only a specification, we need to use it's implemented library to create RESTful web service.
What is Abstract Factory design pattern? The intent or definition of Abstract Factory is “ Provide an interface for creating families of related or dependent objects without specifying their concrete classes ” It is kind of an obscure definition, in order to understand it we need to break it into meaningful pieces. 1. " Provide an interface " When we talk about Abstract Factory we talk about interface not abstract class , Basically this design pattern gives us an Interface, like Interface in Java, C# , Typescript (abstract class). Why interface? Whenever we talk about any design pattern, it emphasizes more on how we are going to use it rather than implement it. Interface is always the right type to prefer because concrete class creates tight coupling whereas an interface isolates it from the rest of the system. At runtime we can get different solution, without updating our code. For example interface SecurityFactory