I really have a hard time with the resume pattern + nested url. I have asked a question, where I am getting right now. My domain is roughly: Schools, schools and teachers of schools are now schools, courses and teachers are not "nested" institutions in this sense that you can refer to any one of these with an ID. The site is a collection of "micro-sites" for each school that shows the curriculum and teachers of each. A course or teacher can be present in only one school.
Say that we have a URL / school / 1 / course / 10 in the school curriculum 10 1. This work is fine. Say that the user changes hands from 10 to 11, which is in existence, but there is a school course. Just goes to a disturbance, my site still "thinks" the user is in 1 school, but as part of the syllabus 3 it shows.
Should I make extension-prone parametric, both of which are asked for ID and "parent" unit (in this case the school) in this? Get from the repository, not with ID but with school barrier?
Or is there a better way to do this?
The way I think about it, that is it; Even if you have 11 courses in the service, there is no resource available in URI / schools / 1 / curriculum / 11. Since there is no resource in this URI, I will return an HTTP 404 response to URI requests.
In a way you can improve your service, replace the integer ID values with the names of the entities (this name will need to be unique). This will make your URI more user-friendly. An example / school / hogwarts / course / nutrition will be.
To further improve your service, you want to give users a way to navigate through various services available through various services. For example, you can definitely allow them to get a list of all the courses provided by a certain school. To do this, you will expose a resource on schools / hogwarts / courses, whose type of return will be a list of all the courses offered by the school. This list may be represented by an XML document such as the following snippet:
& lt; Curriculum & gt; & Lt; Courses Yuri = "/ School / Hogwarts / Course / Defense + + + + + + + Against Arts" Protecting against dark arts & lt; / Course & gt; & Lt; Courses Yuri = "/ School / Hogwarts / Courses / Drugs" & gt; Potions & lt; / Course & gt; & Lt; / Course & gt;
No comments:
Post a Comment