|
Replies:
4
-
Pages:
1
-
Last Post:
Oct 1, 2011 11:38 AM
by: jerome.louvel
|
|
|
Posts:
2
Registered:
6/7/11
|
|
|
|
Please HELP - I cant understand this concept
Posted:
Jun 19, 2011 7:25 AM
|
|
There is this thing which I really can't understand about REST's concept. Suppose I have a resource called Company which has the following attributes : name, address, etc... and another resource called employee with the attributes : name, companyName, etc..
The employeeResource class will implement a method to GET the company name (having the ID identified in the URI) plus the other information ( adrress ... etc )
The employeesResource class will implement a method to GET all the companies names and relevant information
same thing for the employee and employees resource class.
Suppose the client wants to get the name of all employees and the name of the company they work at and its address. so WHERE should the function that performs this query be placed ? and what should be the URI in this case ? here in this case we are not accessing only one resource, but two at the same time as I can understand.
PLEASE can any one help me understand this ?
|
|
Posts:
49
From:
San Diego
Registered:
6/5/10
|
|
|
Posts:
16
Registered:
7/7/09
|
|
|
|
Re: Please HELP - I cant understand this concept
Posted:
Jul 29, 2011 7:01 AM
in response to:
sithlord
|
|
Hello Will,
I'm not sure to really understand your question.
Regarding the employee list, I think that the corresponding URI could be: http://<HOST>:<PORT>/employees/. The returned representation can contain all the hints you expect such as employee name, the name of the company they work at and their addresses. Something like that if you use XML:
<employees> <employee> <firstName>...</firstName> <lastName>...</lastName> <company> <name>...</name> </company> <adress> ... </adress> </employee> ... <employee> ... </employee> </employees>
The server resource for employee list can handle such request. Does it answer your question? Thierry
|
|
Posts:
49
From:
San Diego
Registered:
6/5/10
|
|
|
|
Re: Please HELP - I cant understand this concept
Posted:
Jul 29, 2011 10:13 AM
in response to:
thierry.templier
|
|
Hello Thierry,
I was not the one asking the question. It was the guy from InfoSys who was asking the question, but thanks for the answer.
Cheers, /.Will
|
|
Posts:
133
Registered:
11/4/09
|
|
|
|
Re: Please HELP - I cant understand this concept
Posted:
Oct 1, 2011 11:38 AM
in response to:
sithlord
|
|
Hi Will,
That's true, sorry for the confusion Thanks for your active presence and help in this forum!
BTW, the new MEAP release is coming early next week.
Best regards, Jerome
|
|
|
Legend
|
|
Gold: 300
+
pts
|
|
Silver: 100
- 299
pts
|
|
Bronze: 25
- 99
pts
|
|
Manning Author
|
|
Manning Staff
|
|