• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Exposing controller and services as REST API

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Suggestion from a spring expert saying that we should expose both

1. Controller and Service class as REST APIs
2. When a user sends a request, the controller receives the request. Later the controller should invoke a REST API call to the service method

He said this is the latest design and it has lots of advantages on the same.

a. Is this is the right way ?
b. What does this design is being called ?
c. Advantages and dis-advantages of the above.

Thanks.
 
Master Rancher
Posts: 451
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if what you said is correct, because if you want to expose a service via REST with spring, you are going to use a controller.  What he might be saying is that you make a basic REST api to get only the minimum data from the service, and for the 'controller' you might have something more complicated that involves multiple services.
What are you trying to do?
 
Al Hobbs
Master Rancher
Posts: 451
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually making a call to a rest api in a controller seems a bit insane.  Correct me if I'm wrong, but the only reason I can think of doing that is if you don't have direct access to a service.  I think maybe you misunderstood what the guy was telling you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!