116 reputation
110
bio website extendeddotnet.blogspot.com
location Novosibirsk, Russia
age 27
visits member for 1 year, 7 months
seen Feb 3 at 4:31

My primary goal is creating perfect software. I aim at making it work like a mathematical theorem - without surprises.

I'm .NET and c# fan. I also like WPF/Silverlight, LINQ, asynchronous code (async/await, TPL, RX), ReSharper, Mercurial, etc.


Oct
30
awarded  Notable Question
May
31
awarded  Popular Question
Mar
4
awarded  Benefactor
Mar
4
awarded  Scholar
Mar
4
accepted A Web application as a REST API client: how to handle resource identifiers
Mar
3
awarded  Nice Question
Mar
1
awarded  Commentator
Mar
1
comment A Web application as a REST API client: how to handle resource identifiers
Correcting my own re-phrasing: 'How do I put 3 into my.web.app/pets/3 without parsing the corresponding REST API resource's URL my.rest.api/v0/persons/2/pets/3? Or what do I put there?'
Mar
1
comment A Web application as a REST API client: how to handle resource identifiers
I don't expect the web app to be simply a representation for the api. It can have lots of differences, e.g. show several child resources together with some root one on a single page. I don't want the web app urls to contain the internal ids of the api data storage, if you mean this by saying that I expect the 2 systems to be the same. I'm not concerned with performance here, it's not the problem. The question is actually 'How do I put 3 into my.web.app/pets/3 without parsing REST API Urls'?
Mar
1
comment A Web application as a REST API client: how to handle resource identifiers
My primary concern here is a bit more practical. I use ASP.NET MVC to implement the web app, and due to some internal rules I have to define url patterns the app supports. I.e. if /a/{id} is defined, then the app will handle /a/1, but not /a/1/b/2. This leads to a requirement to recompile the web app if the REST API urls change not only to preserve bookmarked URLs, but also to simply make the web app work when navigated from the root. Simply because hyperlinks embedded into html pages won't work without that.
Mar
1
comment A Web application as a REST API client: how to handle resource identifiers
Yes, it is. And a very underskilled one.
Feb
28
comment A Web application as a REST API client: how to handle resource identifiers
Rodrick, my question is not about building the API, but rather about building a web application that sits on top of a RESTful API. I can hardly understand how media types can help me build URLs for the web app. Although media types are crucial for service contract and discoverability.
Feb
28
comment A Web application as a REST API client: how to handle resource identifiers
Maybe I don't get something, but it seems to me that your answer does not explain how to generate URLs of a web app that is a client to a REST API, does it?
Feb
28
comment A Web application as a REST API client: how to handle resource identifiers
Thanks, Mike. I think this introduces extremely tight coupling of the web app to the api. What if I wanted the URL structure for the web app to differ from that of the api? What if my web app's entities did not map to the api entities 1-1? I still think that I'd better take the approach of exposing some identifiers, but urging the clients to use links for navigation.
Feb
26
comment A Web application as a REST API client: how to handle resource identifiers
I have one problem with this approach. It's actually the number 1 in my list of solutions. What I don't get is this: if the web app doesn't interpret the URLs and treats unique ids as opaque strings (just person/1, pet/3), then how would it know that if a browser opens http://my.rest.api/api/person/1 it should show person UI, and if it opens http://my.rest.api/api/pet/3, then pet UI?
Feb
26
awarded  Supporter
Feb
26
comment A Web application as a REST API client: how to handle resource identifiers
Thank you again. You've described the approach we've taken so far. In a way, we do expose identifiers. The only thing is that we try to expose natural identifiers whenever possible.
Feb
25
awarded  Promoter
Feb
20
revised A Web application as a REST API client: how to handle resource identifiers
More example improvements
Feb
20
revised A Web application as a REST API client: how to handle resource identifiers
One more example