http://memojo.com/~sgala/blog/17.atom ../images/favicon.ico Boxes and Glue Santiago Gala and his Symbols Santiago Gala sgala@apache.org http://memojo.com/~sgala/blog/ 2011-08-31T04:38:26+02:00 tag:memojo.com,2004:17 POST, PUT and Abstract Data Types
Using POST for resource construction seen as a Production operation

I got the Restful web services book (Leonard Richardson and Sam Ruby) from my University Library. Actually I was the one that asked for it to be bought, as I’m teaching Web Application Servers, and I thought it a useful twist on the materials I have been using in the past.

I found an interesting comparison: I usually teach, for a different matter, Object Oriented Analysis and Design, the classic Liskov & Gutka classification on Abstract Types and Operations  (see for instance this PDF, funny that the first page for  the seach was all academic papers in PDF). While looking to how the use of REST methods fits with the classification, I found something obvious and something that was not so obvious for me:

  • an Observer method maps clearly to GET
  • a Mutator maps to POST
  • a Constructor maps to PUT. This would be the classical new operator in java or C# that can’t avoid creating a new object. More on this later.
  • what about creating an object by POSTing to a classy resource? Well, this classification has a category for factory-like methods returning a new object: Producers create new objects, but not as new would, but rather like string concatenation or a factory method would.

This last kind of operation, Producers, is common in OO languages for a number of reasons: one of the big downsides of java and other languages is that new has to return a new object, which prohibits interning of objects, the use of the flyweight pattern and a number of useful techniques. Also, throwing exceptions in initializers is considered rude, and a pain to deal with, and this is the only solution for a new that violates a representation invariant. So producers in the guise of factory methods end up getting used a lot. The alternative, no argument constructors plus bean-like setters, is only useful where the representation invariant is trivial. Also, creation of a related resource, like a sublist of a list or, say, a comment on an entry, is the typical producer field. This is where POST rules.

In REST the problems for constructors is a bit different: using PUT to create a resource is only possible when the client can dictate the URI to the Service, as the URI is a really important part of the representation invariant in REST :) I’m not sure how the use of PUT+redirect for constructing/producing objects is considered by the REST world at large, but I consider it tricky at best. I wonder too how this post as a whole fits with Joe Gregorio practices.

2007-09-14T08:02:27+02:00
tag:memojo.com,2004:17-1189787348 rsvd-deutsche-bank-151.246.205.194.in-addr.arpa form Anton Tagunov POST, PUT and Abstract Data Types The Liskov & Gutka PDF link returns a 404 :-( 2007-09-14T18:29:08+02:00 tag:memojo.com,2004:17-1189839365 http://memojo.com/~sgala/blog/ 172.27.70.188 form Santiago Gala POST, PUT and Abstract Data Types

The Liskov & Gutka PDF link returns a 404 :-(

This was an instance of Google brokenness, as PDFs don’t offer a place to copy the URL from, and I messed it when removing the encoding from google’s result page.

The one I post is from the 6170 course at MIT, it can be found at opencourseware.

On unrelated news, I think I have the POST and PUT use for Mutators wrong. I need to check it and edit, when I finish the September exams rush here.

2007-09-15T08:56:05+02:00
tag:memojo.com,2004:17-1190306135 http://memojo.com/~nostromo/blog/2007/09/19/SantiagoGalaBlog-blogentry-190907-1 excerpt El agente secreto Búsqueda ''simple'' Vía El Pais , cómo: Los facsímiles digitales de valiosas colecciones de casi un millar de manuscritos y libros impresos conservados en bibliotecas públicas del Estado pueden consultarse ya en Internet con la puesta en marcha de la Biblioteca... 2007-09-20T19:35:35+02:00 tag:memojo.com,2004:17-1190702207 http://memojo.com/memojowiki/2007/09/19/B%C3%BAsqueda-simple excerpt El agente secreto Búsqueda ''simple'' Vía El Pais , cómo: Los facsímiles digitales de valiosas colecciones de casi un millar de manuscritos y libros impresos conservados en bibliotecas públicas del Estado pueden consultarse ya en Internet con la puesta en marcha de la Biblioteca... 2007-09-25T09:36:47+02:00 tag:memojo.com,2004:17-1190921825 http://memojo.com/~nostromo/blog/2007/09/19/B%C3%BAsqueda-simple excerpt El agente secreto Búsqueda ''simple'' Vía El Pais , cómo: Los facsímiles digitales de valiosas colecciones de casi un millar de manuscritos y libros impresos conservados en bibliotecas públicas del Estado pueden consultarse ya en Internet con la puesta en marcha de la Biblioteca... 2007-09-27T22:37:05+02:00 tag:memojo.com,2004:17-1286763155 mingzhu9262008@hotmail.com 66.79.163.110 form liumingzhu POST, PUT and Abstract Data Types
Vía El Pais , cómo: Los facsímiles digitales de valiosas colecciones de casi un millar de manuscritos y libros impresos conservados en bibliotecas públicas del Estado pueden consultarse ya en Internet con la puesta en marcha de la Biblioteca...  [link]
2010-10-11T05:12:35+02:00
tag:memojo.com,2004:17-1314595603 shonmarsh123@gmail.com 175.110.78.203 form SHONMARSH123 POST, PUT and Abstract Data Types
I just love your blog.Thanks for posting Web Designing
it. it have something that someone comeback againindustry
….there is a lot of useful information a person can get from here…I must say,well done.A good blog with Doctors
great discussion andTHE NEWS Jobs Ads
a good users,whichLogo designing
contribute in the blog..Your blog keeps gettingjobs in lahore
better and better! Your older articles are not as good as newer ones<a href"=http://www.freelegalcounselling.com/legal-documents/">Nakal Form</a>
you have a lot more creativity and originality now keep it up!
2011-08-29T08:26:43+02:00
tag:memojo.com,2004:17-1314753645 http://www.popbaghouse.com 59.174.189.32 form Louis Vuitton POST, PUT and Abstract Data Types
Brown leather handbags, many of Louis Vuitton the most effective suit. In addition, it appears the great knee boots, and other parts of the cooling of the whole body. Brown leather handbag black leather bag has become the signature of a woman next to Louis Vuitton Outlet the leather handbags. Women enjoy a lovely brown leather personal bags, more single and red and big leather handbags. Brown leather handbag is useful, have very good use. Or brown or Replica Louis Vuitton brown leather bag patent leather handbag, women will not let them brown leather handbags wardrobe to sleep. Brown leather handbags, with Louis Vuitton Waterproof them in daily life every day. Key things, such as the purse or passport. Black leather handbag brown leather handbag is accurate, they can be common. You will find, as some people don’t like pink is designed for Louis Vuitton Monogram Blocks young women.Brown leather handbags are usually different options, size and color. Smart size, you can compact and huge brown leather handbag. They get used to Louis Vuitton Ailleurs the activities of the women for many notable is very useful, such as brown leather handbags, in addition, there will be great. The color of Louis Vuitton Spring Summer 2011 the intelligent choice, brown leather handbags also often distinguish whether there is a compact brown or dark brown leather purse. Whether it is brown leather handbag is Louis Vuitton Spring Summer 2010 very attractive, but dark brown leather handbags looks much better. Tramp brown leather handbags, may be another new brown leather handbag from Louis Vuitton Fall Winter 2010 Bags women interested. This is to create high quality brown handbag brown leather, and striking the middle of the bending with the size of the handbag. Some of Louis Vuitton Prefall 2010 these brown leather handbags patent leather handbags are brown, they are very high price.However, some of this brown leather handbags lower costs, you will handbag from Louis Vuitton 2009 Collection any commercial or mesa. Brown leather handbag it can convey a tramp formal or informal activities. Today, most women are like the brown leather handbags to Louis Vuitton Monogram Denim the office. They operated as its bag brown leather handbag. Brown bag is suitable only for Louis Vuitton Monogram Empreinte their size of the small things, such as lipstick, mirror and the key of the life. Some trends in stylist says, women seem to be more delicate, it has Louis Vuitton Monogram Macassar a more solid bag. The girl like brown shady and cool place, because the purpose, leather handbags, they tend to go to a big brown leather handbags. Important brown leather handbag, far more than Louis Vuitton Monogram Multicolore the spacious brown leather handbag. Although this is a ideal brown leather bag, hire recreational occasions, such as the date Louis Vuitton Monogram Miroir and friends and shopping.
2011-08-31T04:20:45+02:00