May 16, 2008

Pages


Search Site


Topics


Useful Links

Blogs I Read


Archives

Entries for month: January 2008

Hessian: Flex Remoting Without AMF

January 30 2008 by Andrew Powell
For a while now, there has been a versatile remoting solution for Java applications called Hessian. It actually allows for binary transmission of data (much like AMF) between any of the following languages: Java, Flash/Flex, Python, C++, C#, D, Erlang, PHP, & Ruby. Pretty impressive, huh? Hessian is also much more lightweight than using BlazeDS for Java remoting. It is a bit trickier to setup though. Let's start with the servlet config: <web-app id="">
<!-- Configure the HelloWorld implementation -->
<servlet servlet-name="hello"
servlet-class="com.universalmind.helloWorld.HelloWorld"/>

<servlet-mapping url-pattern="/hello/*" servlet-name="hello"/>
</web-app>
This pushes any request coming to http://${servername}/${contextroot}/hello to our Hessian Service, defined here as: package com.universalmind.helloWorld;

import com.caucho.hessian.server.HessianServlet;

public class HelloWorld extends HessianServlet implements IHelloWorld {

   private static final long serialVersionUID = 1L;

   public String hello(String who) {
      if(who != null){
         return "Hello, " + who + "!";
      }
      else{
         return "Hello, nobody!";
      }
   }

}
Note: Notice that this extends HessianServlet. That's how simple the server-side is. With AMF, you have a simple destination to define in the remoting-config.xml file. Hessian remoting actually requires you to create a servlet definition in the web.xml file. The client (Flex) code is actually much simpler and straightforward: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:word="*">

<hessian:HessianService xmlns:hessian="hessian.mxml.*" id="service" destination="hello"/>

<mx:Panel title="Caucho Hessian Hello World"
      paddingTop="10"
      paddingBottom="10"
      paddingLeft="10"
      paddingRight="10">


<mx:HBox>
<mx:Label text='Whom do you want to say "Hello" to?'/>

<mx:TextInput id="who"
         maxChars="20"
         enter="service.hello.send(who.text)"/>


<mx:Button label="Say Hello" click="service.hello.send(who.text)"/>
</mx:HBox>

<mx:Label text='The server said: "{service.hello.lastResult}"'/>

</mx:Panel>
</mx:Application>
We define our service, and the destination (the servlet defined earlier). So all requests will go to: http://${servername}/${contextroot}/hello, the servlet defined in web.xml. Unlike BlazeDS, Hessian allows you to use not just Flex/AIR as your remoting client. It allows you to create one remoting solution for a variety of clients. If your app will have Swing, .Net, and Flex clients, then Hessian is something you should definitely look into. Compile Note: For this to work, you must make sure you include the SWC for Hessian remoting on the Flex side and the JAR for the server-side. Both are available at http://hessian.caucho.com. Deployment Note: A sample war file is attached to this post. It can be exploded using the "jar -xvf Hessian.war" command. The war contains all the source code needed to figure this out for yourself, and is ready to deploy to your application server to see Hessian in action.

Posted in Java | Flex | General | BlazeDS | Universal Mind | Air | Hessian | 5 comments

360 Flex Restaurant Guide Part 2

January 25 2008 by Andrew Powell
This entry will, rightly so, only showcase one restaurant. Muss & Turner's Located a 20 minute cab ride from the conference venue, this place is well worth the trip. It is, hands down, one of the two best restaurants in Atlanta right now, along with Canoe. Canoe will get their own review next, as they rightly deserve it as well. Muss & Turner's guiding principles are "gourmet food, done unpretentious", and my personal favorite, "the belly rules the mind." Deli by day, and full service restaurant by night, this gem is great. The food is all simple, but well done. The dinner menu rotates every three weeks and features fresh, local ingredients (always a good sign). My personal favorite for lunch is the Basic Beef Sandwich with Rosemary Aioli. Other favorites include The Tuscan Raider and the aptly named, "Are You Kidding Me?". The food is only one dimension to this innovative restaurant. The wine list changes daily, and the beer list challenges the wine list in diversity and quality. The staff are as friendly and knowledgeable as it gets. In fact, friendly doesn't begin to describe the staff at M&T. If you are having trouble deciding which wine to pair with your lamb loin, simply ask Turner (a.k.a. Ryan) and he'll be glad to help you find something that will go great and fit your taste. Last, but not certainly least, is the person that I can only describe as the single most creative pastry chef in, if not Atlanta, the entire Southeast. Everything from a pecan chocolate chip cookie that is self-described as "evil" to the more exotic fare such as Candied Bacon Baklava (a personal fave) and the Rosemary and Pine Nut tart will keep your sweet tooth satisfied and coming back for more. M&T is also a purveyor of hertiage foods. This is great for the preservation and continuation of plant & animal species on the verge of extinction. So when you eat at M&T, you can take solace in the fact that you are helping to save an endangered species. (Their heritage grits are actually pretty good for a pair of yankees!) If you have the time while at 360 Flex, then take the time to make a journey to M&T and enjoy a meal that I promise, you will never forget.

Posted in Flex | General | Conferences | 0 comments

1st Half 2008 Speaking Schedule

January 22 2008 by Andrew Powell

  • 360Flex Atlanta - 25 Feb - 27 Feb
    • Building Java Powered Flex Applications

  • cf.Objective() - St. Paul - 1 May - 4 May
    • Enterprise MVC with Java & ColdFusion
  • Webmaniacs - Washington, D.C. - 19 May - 23 May
    • Framework: Fundamentals of Mach II
    • Flex With Java

Posted in Java | ColdFusion | Flex | General | Conferences | JMS | Adobe | Mach-II | Speaking | 0 comments

360 Flex Restaurant Guide Part 1

January 21 2008 by Andrew Powell
OK, since 360 Flex is in my back yard, I feel compelled to act kinda like a good host and help point out where you should eat when at 360 Flex. I will make a series of posts highlighting different restaurants in the area that I'm recommending. First on the list is No Mas Cantina. This is a very short cab ride away from CNN Center and offers some of the best food at the best prices in the downtown area. It's in a hip, revitalized part of town. The margaritas are HUGE and the food is top quality mexican cuisine. It's not your typical mexican, but a bit more upscale. The atmosphere is laid back and easy going. The wait staff is attentive and knowledgeable. Well worth a trip if you are looking for a place to kick back and relax after a long day at 360Flex. Next we have an Atlanta landmark, The Varsity. The Varsity is, if nothing else, an Atlanta landmark. From the call of "What'll Ya Have?" to the Chili Burgers and Varsity Orange, you'll definitely get a taste of history here. It's about 5-10 minutes from CNN Center, but if you're looking to say you've been there, it's worth the trip.

Posted in Flex | General | Conferences | 0 comments

The Best Development Tool, EVER.

January 16 2008 by Andrew Powell
Any developer worth their salt will admit that they do not know everything about their trade. Anyone who does is either a fool or delusional. Plain and simple. With this premise in mind, let's proceed. In the past seven years or so, something wonderful has happened. Developers have really taken to blogging (obviously). This has lead to an unparalleled compendium of knowledge about every development language used today. If you run into an error, or problem that you can't solve, you can turn to a developer's best friend and strongest tool for an answer: Google. If you need a code sample, tutorial, error fix, or bug fix there's a good chance that someone else has already run into it and blogged about it. Just search it. If someone has not blogged your particular tip or fix, go ahead and add to the compendium and blog it yourself. Only you, the developer who uses this great resource for help can add to it. This is a call to arms to developers to try to blog at least one tip or code trick a month for this year. If you do that, we can keep adding to and expanding this wealth of knowledge we have available on the Internet. According to Google Analytics, most of my traffic comes via search engines, and to a smaller extent aggregators. This tells me that people are using search engines more and more to help them with their development. We are, as a community, in essence, training each other. The real kicker to this though is that the other day, I was googling how to do something with Spry and came upon my own blog with the answer. What a kick in the gut that was. I guess it's at the very least, just a bit ironic. I was helping myself with an answer. Go figure.

Posted in ColdFusion | Flex | General | Spry | Google | Adobe | Training | 6 comments