Thursday, August 02, 2007

REST -- web service is all about data (or "resource")

REST -- web service is all about data (or "resource")
---- REST and “domain model must follow data model” again, CSLA again, and FIT again

1. Theory or perspective -- REST and data warehouse: REST is just a completion of the data-warehouse vision: it is totally OO crap saying that data should be wrapped. At higher level, data is visible by users – actually, at that level, data is all users cares. Business logic is just a means to reach the data (‘state”).


“Completion”, because data-warehouse only point out the “GET” (or “R” in CRUD”) – via dimensions – users know dimensions.

REST now put all CRUD (“GET”, “POST”, “PUT”, “DELETE”) in the picture. The key is the idempotent feature: GET is automatically that way, DELETE and PUT also, but is tricky, POST you need to do something.

Note you may simply say REST (“resource”) is closer to “document” point of view, and SOAP is closer to “procedure” point of view. However, for most real programmers, “document” is nobody, nothing, null – it cannot invoke any associations and thinking! The only powerful concept here is “data”. We must understand that from a high level point of view, “data” and “document” are the same thing. SOAP wants to hide data; REST want to expose data. Note that the data is not tiny details, but things like “dimensions”!

This is consistent with other data-centric point of views: for high level analysis, talk data. Do not say users do not know data, they know, and data are all they really care!

Also, saying that you cannot create domain model by data model – again, antique OO crap. The opposite is true: the backbone of the domain model must be data model – if not, then, domain model is wrong.


2. Practice -- REST and client-server: REST makes things simpler for client (with JSON, even vb3 and javascript can do it!), but-and-so, it requires more from the servers (so, regular SOAP must be enhanced-i.e.-wrapped, to deal with issues like e.g. the idempotent issue. Note that if idempotent issue only happens if you think data.

3. Summary: Web Service is at higher level than facade. So, it cannot be procedural anymore, it must be resourceful or restful -- it must be like data warehouse's dimensional.

4. It is funny that CSLA has CRUD everywhere, yet most people cannot see that it begs for REST point of view (its mantra is so-called "a class is determined by its behavior" -- antique OO crap!). Also, it has cross-concern regularity everywhere, yet the most people cannot see (or do not want to mention) AOP! CSLA always surprises me.

5. Also, REST makes more sense to FIT – you shall pay attention to data! FIT is all about data, isn’t it?!

1 Comments:

Anonymous Rodrigo said...

Oi, achei teu blog pelo google tá bem interessante gostei desse post. Quando der dá uma passada pelo meu blog, é sobre camisetas personalizadas, mostra passo a passo como criar uma camiseta personalizada bem maneira.(If you speak English can see the version in English of the Camiseta Personalizada. Thanks for the attention, bye). Até mais.

8/03/2007 09:23:00 PM  

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home