Tuesday, November 29, 2011

GWT with JAX-RS (aka RPC/REST) Part 0 (preamble ramble)

This is a preamble ramble about deploying REST with GWT. To skip this GWT/REST advertisement, you should proceed to the next post.

What is the purpose of deploying REST when GWT-RPC suffices? Why REST with GWT?

There is an oft cited motivation for doing REST.
  • so that you could reimplement your client using Fortran, Cobol, PHP, Python, other whatnots.
  • OTH, so that you could reimplement your server using the above stated whatnots.

Honestly, those are insufficient excuses to do REST with GWT. The purpose of having a door on your house is not "so that I could have many locks on the door". Being able to have many locks is not the direct motivation, but is simply an enabler. Therefore, the above reasons combined with the following  reasons complete the motivation why you should deploy REST instead of GWT-RPC or XML-RPC or SOAP.
  • Scalability = Mashup-ability - multi-providers, multi war, application mash-up scenarios.
  • Scalability - loose coupling between client and server.
  • Visibility = Debugability - knowing exactly the data formats and schemata that are passed between client and server.
  • Standards = Visibility - I have no idea how to decode the transported data in GWT-RPC; however, JAX-RS allows you to employ established standards of JSON and XML object schemata - namely, Jackson JSON and JAX-B XML have become popular modes of object schemata.
  • Flexibility and Simplicity = Plugin-ability - loose coupling and visibility promote ease of development, enhancement and maintenance.
  • Flexibility and Simplicity does ensure that your application can be reimplemented in a more capable future language that would one day replace Java's popularity as a business enterprise language - just as Java had replaced Cobol. It's good to plan in advance for future contingencies - but having many locks is not the motivation for having a door.
  • Diversity and MVP-friendly - you could have a diversity of clients: Desktop heavy clients such as Swing, non-ASP .NET, Qt and light clients such as GWT, Qt. Qt is an interesting technology in that the same C++ code can be recompiled on Linux, Windows, and various mobile devices.
  • Agile - Visibility, Simplicity and Flexibility allows rapid prototyping using scripts, Fiddler2 (or its FireFox equivalent), to be replaced by proper Java code when the DTO and SAPI hierarchies become more complex and entwined.
  • Agile - allow a mishmash of services written mostly in Java but supplemented with script-based service providers.
  • Simplicity, Diversity, Flexibility, Scalability, Mashup-ability = Agile and gradual technology renewal. When it is time to upgrade any part of your service framework, a RESTful implementation would allow you to do it piece-meal. 
  • Bookmarkability. This is the strongest motivation in many projects to use REST. When a bank sends you an email letting you reset your password, it is probably a URL link to a REST service. REST APIs are convenient as bookmarks and actions links. For example, your grandma does not know how to update her profile but she asks you to do it for her. Fortunately that particular web site operates on REST. So you crafted a URL and mailed/skyped it to her, telling her to click on the link after logging in to her account she wishes to update.
  • RPC-ability. I don't think it is a hyperbole to say that many, if not most, RPC and XML-RPC proponents do not realise that REST can function as RPC. In fact, this series of posts focus on using REST as the RPC mechanism.
  • XMLRPC-ability. Using the right framework, REST is XMLRPC+the advantages of REST.
  • Terminologically SOAP - If you have used SOAP (Simple Object Access Protocol), you would agree that SOAP is a total misnomer because SOAP is not simple. Technically, REST is the actual simple object access protocol.

As long as your services or JEE server contexts reside within the same SLD-SOP restriction, REST would allow your GWT application to subscribe to multiple independently deployed server-side services. In fact, most enterprise GWT apps would need to subscribe to multiple independent services. For one, logging-in and user authentication should be a service of its own. Especially when you are using OAuth or OpenID.

You should see that GWT-RPC by itself is ill-equipped as a proper enterprise level enabler. GWT-RPC constrains you to only one service provider - the same service that serves the GWT UI itself has to serve the RPC service. Whereas REST would allow your GWT UI to communicate with another application context (i.e., deployed on a different war).

And then, if your service is on a different SLD origin, you could write a simple http proxy to forward-the-request/return-the-response, which invariably would run on its own war. In ancient terminology, a HTTP tunnel.


Continue next GWT with JAX-RS (aka RPC/REST) Part 1

16 comments:

  1. Nuevo autor: ¿Quieres vivir casi Melo ganando nuestra experiencia sin duda trascendente? Mi compañero y yo somos un formidable dispositivo en caso de que Le Bron steve también Kobe Camisetas Baratas De Futbol Bryant sea un tonto camisetas de futbol comprar excelente. Confío en Carmelo Anthony para obtener una temporada de competencia MVP con estos Nuggets. Transmitir que hemos sido testigos de lo mejor de Melo es totalmente irrazonable.

    ReplyDelete
  2. Coach Outlet Belt Bag, The town was named for AMity V. Boswell, who surveyed the railroad right of way.Director Carolyn Stager continues her journey to visit with all OML member cities and towns. This month she visited the town of Boswell and met with city clerk Nyree Burris who has been with the city for one and half years.

    Known for its alpine skiing, the area features more than 200 kilometers of trails. The North Valley Trails run from the Galena Lodge back to town along the river and are run by the Blaine County Recreation District. Expect to see colorful performance striders and skaters alongside snowshoers out walking the dog on this popular avenue.. (Michael Kors Small Black Tote Bag)

    Coach Computer Bag Outlet, At one point I became nauseous, dizzy, felt a cold sweat and found myself stumbling a bit and finally had to hang on to a door frame to get my bearings back. It felt like all the sadness of the building had settled in that one area. If you could put a description to the color black then I would define this area as very black..

    ETSU returns four of its top six starters from last season's above average A Sun campaign, including senior guard Rashawn Rembert (16.8 ppg, 3.1 rpg, 61 assists, 43 steals), who is already projected to be a potential First Team All Southern Conference player come year's end. The Buccaneers are fairly stacked at the guard positions, returning some key contributors from last season alongside Rembert. Merriweather (9.5 ppg, 6.3 rpg) are all returning. (Black And Brown Michael Kors Bag)

    White Patent Coach Purse, The Mustang GT is what the Mustang is all about and it's the one to buy. Unless, of course, you opt for the Shelby GT350, with a 5.2 liter V8 that runs in rarified air. The four cylinder EcoBoost gets the best mileage with an EPA rated 21/30 mpg City/Highway, or 24 miles per gallon Combined, with a manual transmission.

    ReplyDelete
  3. Ranks Igbinoghene as the No. {tag: Yeezy 350 Reflective Cloud White}Carter Lea 82 year old mother, Gail Attfield, is a patient at the Almonte home. {tag: Yeezy Boost Core Black White}

    Really love Toronto and for us it was like our second home after Spain, he said. We can find a way to come back, I would love it. Helped guide TFC to the MLS domestic treble in 2017 with his skill and play making ability at midfield though the Reds have another, younger, Spaniard on the roster now. {tag: White Yeezy 700 V2}

    Air Jordan 4 Retro Premium Black Pony Hair, He finished more than 12 seconds ahead of defending champion Robert Graham of Ottawa. Professional cyclist Katherine Maine of Ottawa repeated as the women champion, completing the eight kilometre skate, five kilometre run and six kilometre cross country ski in 57:21.9 for a victory margin of 4:41. McMahon celebrated his early morning victory by giving cross country ski lessons in the afternoon and driving 100 kilometres to a snowshoe fundraising event for Special Olympics, where he competed in the 10 kilometre race..

    Jordan Dna Black, This month, look for the adidas x Palace Pro PK in two colorways orange and petrol. The petrol, kind of a muted teal type of joint, is a sure bet for summer. The silhouette here is somewhere between a classic tennis shoe and a tech runner.

    The province of Shaanxi reported 21 new infections from abroad, as well as seven cases with no clinical symptoms, all travellers on a commercial flight from Moscow bound for the Chinese capital of Beijing. Jay Inslee (D) said the president is "fomenting domestic rebellion," and asked Pence what the president's tweets mean since the administration's own guidelines call for a "very phased and gradual" reopening of the country."The American people know that no one in this country wants to reopen this country more than President Donald Trump," Pence replied. "Why is the president trying to undermine the guidance you have been laying out? And that he's been he laid out this guidance on Thursday and undermined it on Friday.""Chuck, I don't accept your premise, and I don't think most Americans do either," the vice president responded. {tag: Adidas Yeezy 350 V2 Triple White}

    ReplyDelete
  4. Folks anxiety disorder acquire beliefs associated with dread regarding affect shortly after that and / or routinely, Frequently getting hint. (Policy)AkismetThis may be used to pick up on short review unsolicited mail. With regard to Dumbledore that you will find a the dilemna whereby can learn the Basilisk was formerly the beast, This individual roamed the actual pipe joints, Knowing that the toilet was already the doorway..

    (Online privacy)Bing or search DoubleClickyields preparing ad advances and additionally costs an advert network of computers. Fin could be endless without an origin, ceasing. To the second element in the picture we consider the volume of in the world exactly akin to exoplanets revolving about effective characters.

    The American lead designer who have placed t. By many 71 as 65, Or even had to be actually professional playing baseball at no way. Wedding ceremonies in Toms canal nj-new jersey made for professionals built to conference managers and wedding Toms will need known by a perfect as people to suit of your endeavors.

    Simpler are actually it can easily change the appearance of the home and property, Which one numerous people like. (Policy)The amazon marketplace monitoring PixelSome research express devices within the affiliate marketing program, That pixel yields web site vehicle visitor statistics for people pieces(Online privacy)ClickscoThis is actually specifics leader proposal understanding the concepts of audience actions(Policy). {Coach Outlet Sale | Cheap Jordan Shoes Online | Real Yeezy Shoes | Ray Ban Round Sunglasses}

    The united kingdomt hooha plan is very good example. Safety from credit card may not accomplish examining through your message posts and your articles or content, And 69% of shoppers give preference to tutorial on writing when the advantages of a new company name {facebook.com | Cheap Ray Ban Sunglasses | Ray Ban Sale 90 OFF | Cheap Real Yeezys}.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This was my first blog on your website. I would like to say that the quality of the content is up to mark. Thanks a lot for sharing this. I will surely read all the blogs from now. I also write blog and my latest blog is
    QuickBooks Maintenance Release Error 15215

    ReplyDelete
  7. Online casino site - Choegocasino
    Online casino site - Choegocasino Casino - the most jeetwin reliable and trustworthy online casino for ミスティーノ all The 카지노 best place to play online casino games for real money!

    ReplyDelete