The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
I am fairly new to development and have been asked to look at creating a MVP Rest Web Service so our clients can query a database. I am looking for advice. I have scoured the internet but have not found a lot of specific examples. Any help or advice would be gratefully received
So, assuming that by MVP you mean Model-View-Presenter, you're highly unlikely to find much as far as examples go. For one, the in-vogue architecture for web applications is actually a cousin of that pattern, the MVC (Model-View-Controller) architecture. Second, web services are intended to exist at the data access layer and (at least partially) the business logic layer of n-tier applications, so presentation logic is not a consideration for a pure REST API.
Suggestions for frameworks or platforms will depend on what language you intend to use. You might want to ask in the language-specific forums about what technologies might give you a head start.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
REST services have controllers, the endpoint is in effect the controller.
To me it makes no sense to have a presentation layer or a view layer quite simply because REST does not serve a page but serves a response which will contain a header and a body generally containing JSON rather than HTML with CSS.
One pattern for a REST service is:
Controller - the endpoint
Orchestrator - receives request from the controller and serves response to the controller
Repository - basically the database connection
Model - a structure defining the data within requests and responses
MVC and MVP are patterns used for web pages - I have not seen those patterns used for REST services.
[I stand corrected by my post below where I have posted a tutorial to a Microsoft Web API MVC tutorial)
“That which can be asserted without evidence, can be dismissed without evidence.”