TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Someone Save Us From REST

42 点作者 subdigital超过 13 年前

8 条评论

xivSolutions超过 13 年前
Crack me up.<p>I am still learning programming the hard way - namely, by checking out how other folks do it, then struggling to do it myself. However, I've learned enough, I think, to get the impression that some people get rrrreeeallly attached to their architecture.<p>I have come to believe that all these models, "patterns" and such are very useful tools, but only that. Seems like we keep having these religous wars about language, patterns, architecture, whatever.<p>All of it is only useful as long as it, well, useful. When the "architecture" starts hindering the function, it has stopped doing it's job.
skogenik超过 13 年前
I used to be a programmer like you, then I took a Paradigm to the ... sorry, I can't do it.<p>You raise very good points though are we asking to be saved from REST or REST Pedants who argue about minutia ?
neilk超过 13 年前
I have not yet seen any application that would be improved by full HATEOAS. Fielding argues that you need it if you intend to be around for decades. Guess what, the Flickr API is verging on a decade and it's still doing fine.<p>Some things in the Flickr API could be nicer with more HATE. For instance, currently, the client needs to know how to turn a returned photo ID into a URL. Fielding would ask why the API doesn't just return URLs in the first place. (One answer: because that would be inanely repetitive.)<p>But that's mostly cosmetic. Yes, we expect the client to translate IDs to page URLs, but we also expect it to understand what the difference between a photo and a user is.<p>Nobody has explained to me how "Hypermedia" APIs are supposed to be traversable without a programmer embedding significant domain knowledge into the library anyway.
sukuriant超过 13 年前
You're going to need a ControllerFactory for those Controller's; but at least you're using MVC. Did you remember to not have your Singleton instance instantiated until its first call?<p>Programming is an art as well as a science; and those papers were guides to direct us toward something useful, not to be followed as creed and memorized to be recited in a religious ceremony. The sooner people learn that, the better.<p>In all, I agree with your the post.
carsongross超过 13 年前
What, an methodology that encourages (pedants note: I did not say mandates) a CRUDdy API, where resources are grouped together behind different urls, making automated interactions of any significance an almost hilariously slow series of HTTP requests (oh, oh, oh, keep alive!) while at the same time giving the API designer a smug sense of satisfaction and accomplishment might be worth looking at skeptically?<p>Naaaaaaaaaah.
jongalloway2超过 13 年前
Nice explanation from Glenn on both implementation decisions - both separate controllers and different url's: <a href="http://codebetter.com/glennblock/2012/02/28/why-are-there-2-controllers-in-the-asp-net-web-api-contactmanager-example-rest-has-nothing-to-with-it-2/" rel="nofollow">http://codebetter.com/glennblock/2012/02/28/why-are-there-2-...</a>
Mayank_超过 13 年前
Brilliant post with intended humor. I see some bigger points here, beyond the discussion of REST. Like a satire on design and (over) engineering.
johncoder超过 13 年前
Awesome post. Love how Rob questions things and stirs the pot. Several good points.