Archive for February, 2008

Don’t be a refactoring bigot (follow-up)

Thanks to Justin and the comments on his post (No, Be a jerk), for expanding on my blog post and taking the discussion to a much more sophisticated level than I started. Instead of “Don’t criticize code”, I think this will be more suitable title of the paragraph: “Give constructive criticism”. I agree […]

Services != Distributed Object

(The title quotes Joshua Graham’s comment here) I agree completely with Josh. In a casual conversation with Tim Cochran of Thoughtworks, we both felt that using RESTful controllers does not mean exposing all of your model objects, or database tables. Thoughts still need to go into designing the right interfaces.
In Rails, examples of […]

ActiveResource and handling a weird 204 response from a remote rails controller

In the examples given in ActiveResource Rails API, when ActiveResource does a PUT (e.g. update) to a remote RESTful rails controller, the rails controller is supposed to return a HTTP code of 204 (No Content).
But if the remote rails controller actually does that:
head :no_content #204
The Http response that ActiveResource receives is a Net::HTTPNoContent, with no […]

Trying out ActiveResource in 3 minutes

Recently I started using ActiveResource to talk to a RESTful controller (which is also done in Rails 2). It is very nice and simplifies a lot. With Rails 2, out of the box you can create a sample RESTful server and client in 3 minutes:
Server:

>> rails test_server
>> cd test_server
>> script/generate scaffold Account […]