Mon, 23 Aug 2010 21:04:19 +0100 From stackoverflow.com
I have read up many articles on Rest, and coded up several rails apps that makes use of Restful resources. However, I never really felt like I fully understood what it is, and what is the difference between Restful and not-restful. I also have a hard time explaining to people why/when they should use it.
If there is someone who have found a very clear explanation for REST and circumstances on when/why/where to use it, (and when not to) it would benefit the world if you could put it up, thanks! =)
Content-Type: text/x-flamebait
I've been asking the same question lately, and my supposition is that half the problem with explaining why full-on REST is a good thing when defining an interface for machine-consumed data is that much of the time it isn't. OK, you'd need a really good reason to ignore the commonsense bits (URLs define resources, HTTP verbs define actions, etc etc) - I'm in no way suggesting we go back to the abomination that was SOAP. But doing HATEOAS in a way that is both Fielding-approved (no non-standard media types) and machine-friendly seems to offer diminishing returns: it's all very well using a standard media type to describe the valid transitions (if such a media type exists) but where the application is at all complicated your consumer's agent still needs to know which are the right transitions to make to achieve the desired goal (a ticket purchase, or whatever), and it can't do that unless your consumer (a human) tells it. And if he's required to build into his program the out-of-band knowledge that the path with linkrels create_order => add_line => add_payment_info => confirm is the correct one, and reset_order is not the right path, then I don't see that it's so much more grievous a sin to make him teach his XML parser what to do with application/x.vnd.yourname.order.
I mean, obviously yes it's less work all round if there's a suitable standard format with libraries and whatnot that can be reused, but in the (probably more common) case that there isn't, your options according to Fielding-REST are (a) create a standard, or (b) to augment the client by downloading code to it. If you're merely looking to get the job done and not to change the world, option (c) "just make something up" probably looks quite tempting and I for one wouldn't blame you for taking it.
techrest Sat, 07 Aug 2010 17:50:20 +0100 From github
A less resource-heavy way to do realistic regression tests (and
eventually load tests) than controlling an actual web browser
a la watir.
- Interact with your web site using Firefox.
- Capture the requests sent with Tamper Data, and export as XML
- Replay them from the command line
- with realistic timing
- with SSL support
- with a 'rewrite' step that lets you programmatically change the
request data before sending it (e.g. to switch hostnames from
production to test, or vice versa)
- using the single-threaded low-overhead goodness of EventMachine
For an event this autumn that I'm probably not allowed to tell you about, $WORK needs a web site that deals with 50x as many transactions as the current box. Current plan is to move it into the cloud and add memcached for everything that might conceivably benefit, but step one in performance tuning is, of course, to get a baseline.
And it's an excuse to learn EventMachine
techeventmachineruby Wed, 05 May 2010 15:57:31 +0100 If you have a tech-friendly ISP (like mine ) your DSL service might not only have a static IP address (one that doesn't change each time you reconnect) but several of them. In my case, 8 (five usable).
If you have a Draytek Vigor router, you can configure it to know about these using the 2nd subnet support - this is what I did before I moved, with the 2600 I had at the time
If you have the specific Draytek Vigor 2700 model that I have (and I don't know how wide a problem this is) you may attempt to follow these instructions but find that the configuration options for second subnet are missing. The option for DHCP relay agent is missing too. I tried a bunch of stuff including factory reset, firmware upgrade, and "phone a friend" to resolve this before eventually grasping the nettle and fiddling with firebug and HTML "view source"
The situation seems to be that the router is entirely capable of doing both these two things (if you're reading this, it must be) but javascript variables govern whether the HTML configuration interface actually lets you, and for no reason I can think of these variables (called HIDE_LAN_GEN_2NDSUBNET and HIDE_LAN_GEN_DHCPRELAY) are, on my router, set to true. So, login to the router, pull up the firebug console, enter
parent.HIDE_LAN_GEN_2NDSUBNET=false
parent.HIDE_LAN_GEN_DHCPRELAY=false
and then choose "This frame", "Reload" from the rightclick menu in the main frame, and you should find they magically reappear and you can configure them appropriately. This will almost certainly take you less time to do than it did me to work out.
techdraytechvigor2700adminmissing2ndsubnetdhcprelay Wed, 05 May 2010 10:32:37 +0100 Extended outage, yes. I moved house. That wasn't itself the problem: the problem was that the machine which runs this blog decided after the move that it didn't want to run for more than a few hours at a time without panicing randomly.
After replacing the mouse (no, really, the USB-serial interface it was plugged into seemed to be sporadically disappearing from view), hoovering out the inside of the case, reseating all the cards, and various other forms of voodoo, it seems to have been made stable by a couple of BIOS tweaks I found on overclocking forums: upping the northbridge voltage and dram voltage by 0.1V. Apparently this is a common problem on the Asus P5Q-EM when it has all four ram slots full.
And no, I'm not overclocking it.
Anyway, I have a stable (so far) system again and blogging service will resume soon. First up: it must be late last year that I started playing with Ruby, so it must be about time for the 6-month review.
techasusnorthbridge Wed, 24 Feb 2010 16:35:12 -0000 Part II of the financial thingy is on its way, along with a subjective evaluation of the merits of rspec (I quite like it), but in the meantime have a look at http://github.com/telent/pacioli which is where the work in "progress" is going. I say "progress" because that's a daytime job and, well, something else came up at work.
In the meantime, please feel free to wander across to http://telent.posterous.com/ which is where I'm describing my attempts to put an embedded "Mini2440" Linux system in the Firebrox pedalled sound system
linuxmini2440
|
telent netowrks
Geeky stuff about what I do. Many include Lisp, Android, Javascript, Linux and matters arising. For my other personality (less tech and more skating/cycling), see coruskate
|