60 points · by mfenniak · 13y ago · 53 comments
I'd recommend you make it clearer that the linking lines between nodes are clickable. Even better, rather than using a modal dialogue to display node contents, you could use a popover with an arrow pointing to it's owner. Clicking a link a the bottom of an item would simply move the popover, making the relationships between various items of content clearer.
On the topic of idempotence..we recently made our platform distributed across 4 datacenters using queues. None of us really knew what we were doing. Recognizing this very early on, we made all calls idempotent. Pretty sure that single decision is what made the entire system work.
I know they don't get too much love on HN, but it would be cool to see this done for a set of enterprise integration patterns.
See:
http://www.eaipatterns.com/toc.html
http://camel.apache.org/enterprise-integration-patterns.html
The enterprise integration patterns links are interesting to me; thanks for point those out. I can definitely see how they could use a connection to reality. I can look at a random one and see what it is, but understanding why you'd use it is a mile above my head.
The link to Apache Camel is a bit more informative with actual examples with code snippets.
Idempotence (literally "same power) in a REST API means a given request produces the same result whether you execute it once or multiple times. Given the URL:
/resource/1
Whether you execute the DELETE method on that resource once or ten times, the resource is deleted. Therefore, it is idempotent.
Assume for the moment that DELETE on /resource/1 actually removes /resource/1 from the namespace, and doesn't do anything else (other than logging; logs don't count). If DELETE is idempotent in this case, then whether you call it one time or ten times, either way, /resource/1 is not there when you're finished, and nothing else has changed. The client might see an OK response to the first call and error responses to the others, but from the server's perspective, it's the same as if the call had only been made once. That's what makes it idempotent.
This seems like a rather hollow meaning of idempotency. HTTP is a communications protocol. Why bother specifying idempotency if it doesn't apply to the communications?
The client gets no benefit at all if the server doesn't faithfully serve idempotent responses, and in fact a great deal of the benefit of idempotency is lost. Specifically, the client cannot reasonably resume a dropped connection if the server changes its responses during a retry scenario (which RFC2616 says the client should do). Would it be idempotent if the first response to "PUT /foo" was 204 and the second response was 405?
Edit mfenniak suggests using HTTP 410 Gone instead, which makes more sense than 404 Not Found if you can configure your server to remember that a resource was deleted.
The spec regarding this: "A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity."
204 is what I would return for most DELETEs because there is no status (entity) left after a normal delete.
As an API consumer, I would prefer a 404 not found - so that I may easily and accurately populate up the information that a resource I expected to be there, and to delete, wasn't there when I tried to delete it. Especially in complex applications where various clients may be running against the same data set across many distributed nodes, this can be demonstrative of many much harder-to-find problems when every action is "success."
I also would prefer 200 - with a description of the entity that was deleted, again, for verification and system maintenance needs.
Because that is useful information. What benefit is there to hiding the information?
If delete is considered idempotent despite changing the status code for repeated calls, then we must consider the status codes to be irrelevant to idempotency, which seems like completely wrong.
response.status = rand(); // is this really idempotent?Making good abstractions for a complicated system is always harder than just a 1:1 API.
Ex. "Request = DELETE ID 1"
First request, ID 1 is deleted. Second request, ID 1 has already been deleted. Third request, ID 1 has already been deleted.
And, I don't even think it should be a requirement (depending on the role), if said boss hired you because you have the technical experience needed and trusts you, and is willing to learn, I wouldn't mind working for him.
http://management.fortune.cnn.com/2011/06/01/why-bosses-dont...
My question was really, given this shared understanding. Why is this limited level of autonomy so common? How much longer can work that requires deep technical knowledge be directed and controlled by those who do not understand it.
In short, why are bosses not mentors. I don't mean in the general sense, I mean literally. My boss should be the person I respect, not who I answer to.
Don't get me wrong, all of those are generally good things, but if you can't draw up a diagram like that in 30 minutes for any design pattern, best practice or standard you follow, you should take that as a hint that you're doing something wrong.
I've variously heard people say both i-dem-PO-tent and i-DEM-po-tent. (In the latter, the "o" in "po" gets reduced to a schwa.)
Fixed point is another way to get at it, although it requires your listener to know what that is.
I mean if it were some consumer property, like say the size of a hard drive or such, then yeah makes some sense, for a term used in strictly in technical circles to describe a precise technical property, I don't understand what 'nicer' means.