Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 748515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:19:45+00:00 2026-05-14T14:19:45+00:00

Simple examples of controllers in a RESTful architecture suggest four actions per controller —

  • 0

Simple examples of controllers in a RESTful architecture suggest four actions per controller — index, create, update, delete — corresponding with the GET, POST, PUT, and DELETE. But beyond that I still find a dozen little decisions:

  • Do you have a different controller for resource collections (example.com/things) than you do for an individual resource (example.com/things/123)?
  • With individual resources, is it preferable to pass the id in as a parameter to the action, or set it as a member variable in the controller class?
  • How do you go about URI routing? The old tried-and-true example.com/{controller}/{action} approach kind of falls apart.
  • What about subordinate resources like example.com/user/123/things? Do you have to explicitly define every route for these or is there a way to write a good general rule?
  • Do you differentiate between API requests and browser requests, or do you channel them through the same controller and/or controller methods?

Obviously, you could go about these things a dozen different ways, but I’d really like to not have to re-invent the wheel if others have hashed through the problem. I’m looking for any advice or maybe better some good tutorials that deal with these (and other related) practical issues in designing a RESTful mvc framework.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:19:46+00:00Added an answer on May 14, 2026 at 2:19 pm

    My controllers have methods Get(), Put(), Post(), Delete(), etc. I think using the “action terms” confuses the issue.

    I always create a different controller for collections and single things. To me they are very different resources and I want the HTTP methods to do different things.

    Routing I do differently than most frameworks. I don’t match on the entire url, but on a segment by segment basis. It is similar to the way SubResources work in JAX-RS

    For services that only have a small number of distinct resources then using regex style url pattern matching is fine. I just found it started to break down once you start dealing with hundreds of resources.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following the CakePHP ACL tutorial http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html I have a controller called ImagesController
All the simple examples of geocoding load a hard-coded long/lat pair and then, after
I am attempting to use a jquery drowndown checklist control. Following some simple examples,
i am using facebook android sdk provided for facebook i m using their examples-simple
I have a very simple ColorBox gallery setup just like the examples. Simple tags
Most of the DAO examples I've seen consist of simple queries only involving one
I googled on how to unit test but examples are so simple. the examples
I am starting a simple .NET project with FluentNhibernate . I've followed few examples
When dealing with events, people are usually taking examples of very simple values object
How can I render after executing an action in a restful controller instead of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.