Why ActiveResource will flop

And of course you can get around that restriction by popping the word
‘Beta’ somewhere on
the accompanying web page.

:slight_smile:

Robert J. wrote:

How would you feel if your GUI app broke every time I refactored?

This is a Frequently Asked Question regarding the interaction between
Agile development and published interfaces.

The answer is to apply more of the Agile development practices -
specifically Customer Tests. Each feature your customer wants, you
deliver it with a suite of Acceptance Tests that lock down the
feature’s specifications. Done right, your customer should author
these tests, or at least review them.

So if your customer wants a web service, they get a set of tests
specifying that web service’s published interfaces. You are now free
to refactor all you like. If you break any test, you revert and try to
refactor again.

BTW “Refactor” doesn’t mean “code-and-fix with your design”. It means
“change the design while passing all its tests”. Re-read all the
verbiage about refactoring with that in mind.


Phlip
http://c2.com/cgi/wiki?ZeekLand ← NOT a blog!!

I may be a little confused here, but bear with me.

From my understanding, ActiveResource is the class to consume XML
(client side) and ActionWebService is the server side.

So how would ActiveResource break your GUI app, when it is not even
used? It reflects on whatever comes back from response.

Second, if you are talking about ActionWebService’s reflection
capability messing up your API, shouldnt you also make sure that your
refactoring works correctly? If i change a method on the API (by
adding/changing a column or whatever), shouldnt I also make sure that
the original API calls work (maybe throwing a Deprecation Error and
letting the user know there is a new method).

Isnt that how the RAILS framework is built in the first place?
Example: Rails has now deprecated the form_tag, but i still use it and
deal with the warning. (Before you guys jump on me about that, I
already know i should be using form_for :slight_smile: ) Eventually, i will use the
new method, but it is my choice.

Its not the framework’s fault that you broke a method.

Personally, i love the reflection in all parts of the RAILS framework.
I expect it to do that. And when the time comes to make changes, i will
keep that in mind and code accordingly.

peace

–jake

Robert J. wrote:

One of ActiveRecord’s greatest strengthes is its fluidity. Change a col
in your db, restart, wham!, new class.

This type of behavior is great for internal code. But for published
interfaces, it’s the exact opposite of what you want. Let’s say I have
a calendar web app, and expose a web service - via ActiveResource - for
you to hook in your local GUI app (or command line app, or complenetary
web app, or whatever you use ActiveResource for):

How would you feel if your GUI app broke every time I refactored?
How would I feel if I couldn’t refactor because doing so will break all
those GUIs?

Thought so.

A web service interface needs to be stable, hiding the implementation
and any changes in it. It needs to be decoupled from changes ot the
internal schema.

Rails is built on extraction. It seems to me that ActiveResource -
along with all the upcoming REST pixie dust - has been dreamt up before
actually being used in succesful apps. Is there any publically
available app exposing an ActiveResource api? Does it have any external
clients?

I’m all for REST, and I’d love to see a RESTful competitor to SOAP, but
it needs to be stable, static, decoupled from internals, and
discoverable via something like WSDL (yes, WSDL can be used for REST
too.) I think the Rails community is the best posed to make it happen -
but not like this.

(I’ll end my comments by pointing out that I think Rails is great. I
hope my constructive criticism is received in the spirit it’s intended.)

Ouch. I appreciate that the point is well meant David, but it comes
across a little harsh.

It was not meant to come off as “a little harsh”, it was meant to come
off as harsh. The good tone of this list, and other Rails community
outlets, is valuable and precious and worth standing up for. It doesn’t
take much more than good men to do nothing for that to deteriorate the
way this original post started out. No technical discussion and no
potential diamond debater in the rough is worth that.