Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What design pattern to implement in order to use a REST API?

I'm starting a new project that will require use an external REST API that basically returns JSON and XML files. It's similar to the StackExchange API and I see every wrapper that has be done for that API has a different approach; for instance, stackoverflow-java-sdk uses the Adapter Pattern.

So, in order to make sure every new API feature will be included easyly... what would be the best design pattern?

like image 336
Cristian Avatar asked Jul 02 '10 16:07

Cristian


People also ask

Which design pattern is used in REST API?

RESTful APIs should take advantage of HTTP methods, or verbs, such as GET, PUT, and POST. RESTful API Design Patterns: API design patterns provide a description or templates to solve specific, recurring API design problems that any software architects and API designers would like to adopt in their API designs.

Is REST API a pattern?

Representational state transfer (REST) is an architectural design pattern for APIs. APIs that follow this pattern are called REST APIs or RESTful APIs. REST sets certain standards between computer systems on the web that make it easier for systems to communicate with each other.


1 Answers

The Bridge pattern can be used to encapsulate two interfaces so they can vary independently. Sounds like what you're interested in.

like image 105
Dave Avatar answered Oct 26 '22 23:10

Dave