July 3, 2008

Pages


Search Site


Topics


Useful Links

Blogs I Read


Archives

Your MOM Is The Future Of The Web: WebNext

June 27 2008 by Andrew Powell

If "Web 2.0" was all about interactions and experience, then what I like to call "WebNext" is going to be about how we communicate with our services. The experience revolution that we've been a part of in the last 5 years has changed the way we use the Web, but WebNext will fundamentally change the way applications communicate and that will open up doors we never thought possible.

So what is going to drive all this? Well, it's quite simple. Ever since we've had the Web, and into Web 2.0, server communication has always been synchronous. The client makes a request and waits, in some form or another, for a response. The concept of WebNext is driven by Message Oriented Middleware (MOM). MOM brings a level of asynchronicity to the client-server communication paradigm that is just now starting to get traction in the enterprise sector. With MOM, your application sends a message to a message bus (cloud), then immediately goes about its business. Whether or not you listen for a corresponding response message from the bus, or if the server even responds via the bus, is totally unrelated the message you initially sent. It is a total shift from the request-response model we are used to now.

Let's stop for a minute and think about what this means in terms of development. Developers can now truly develop both the client and server (and back-office processes) in parallel to each other. As far as each tier is concerned, everything else that it communicates with is just a "black box". You can develop your client independent of the server, as long as you know what messages for which to listen and what messages you want to send and how to send them. It's pretty straightforward, once you break the components down.

The client level platform can be anything that can communicate with the message bus. Same goes for the servers and back-office processors. The bus that is the most prevalent foundation for architecting MOM powered applications is JMS. A good number of Enterprise Service Buses (like Fiorano), which expand on the concept of MOM, are running on top of JMS. At the moment though, Microsoft's MQ not withstanding, JMS is the most user-friendly and standards-based API available to implement MOM. JMS, at this point in the MOM concept, is a solid platform for implementing MOM type architectures.

Where does this bring us with WebNext? In WebNext, applications become independent of a particular web server and middleware. In WebNext, applications become message relayers, message creators, message readers, and message destinations. Applications gain true autonomy in this server independence. Applications will be able to communicate with a diverse and distributed set of services, ranging from an .NET app (there are JMS adapters) to Java apps to tiers such as ColdFusion. Security models can be setup that will make services either trusted or untrusted, authenticated or not, etc. The crux of WebNext is that it will give us a truly distributed web.

I believe that going forward, for the Web to remain relevant, it needs to be changing and evolving. This paradigm of WebNext via MOM is the next evolution for the Web. If, at the client level, we are able to, at least partially, break out of the request-response paradigm, why can we not break out of it when it comes to the server-side? The current communication, at its heart is still request-response and synchronous. Asynchronous requests to the server will allow us to open more doors and process data in methods currently not thought of as "standard practice". WebNext is the future, it's just a matter of how quickly we get there.

Posted in Java | ColdFusion | Flex | General | JMS | MOM | WebNext | 5 comments

Serialization: It's Not Just For Remoting Anymore

June 26 2008 by Andrew Powell

Flex Messaging is, by far, one of the most under-appreciated and unexplored parts of both LCDS and BlazeDS.  Everyone has seen the ubiquitous chat demos (I'm even guilty of this one myself) when people have shown you what FM can do for you.  Flex Messaging, I contend, is even more important and powerful than the more well known piece of LCDS and BlazeDS:  Remoting.

 Just like remoting, the messaging communication is AMF and happens over port 80 and HTTP, unless you're using RTMP, then it's a different port and protocol, but it's still AMF.  If you are using JMS as your messging provider, and have a corresponding java object, that AS object will be deserialized to the corresponding Java type and the resulting POJO will be placed, by Flex, into the JMS topic or queue.  Basically, this lets you send typed Objects to JMS from Flex, not just anonymous Objects or plain text.

On the receiving end, if the message receiver has access to the same class (via jar, etc), then you can cast the ObjectMessage to your type.  This allows you to pass objects from Flex to Java via JMS without worrying about typing.  Pretty powerful, but pretty unknown as well. Code samples to illustrate my point are below

 

 

Person.as
package com.universalmind.model.vo {        
   [RemoteClass(alias="com.universalmind.model.vo.Person")]
   public class Person    {       
      public var name:String;       
      public var age:Number;       
      public var department:String;       
      public var username:String;       
      public var password:String;              
      
      public function Person()       {       }                  
} }

Person.java
package com.universalmind.model.vo;
import java.io.Serializable;

public class Person implements Serializable {
   private String name;
   private int age;
   private String department;
   private String username;
   private String password;
   
   public Person(String name, int age, String department, String username, String password) {
      this.name = name;
      this.age = age;
      this.department = department;
      this.username = username;
      this.password = password;
      }
      
   public Person() { }
   
   public String getName() {
      return name;
   }
   
   public void setName(String name) {
      this.name = name;
   }
   
   public int getAge() {
      return age;
   }
   
   public void setAge(int age) {
      this.age = age;
   }
   
   public String getDepartment() {
      return department;
   }
   
   public void setDepartment(String department) {
      this.department = department;
   }
   
   public String getUsername() {
      return username;
   }
   
   public void setUsername(String username) {
      this.username = username;
   }
   
   public String getPassword() {
      return password;
   }
   
   public void setPassword(String password) {
      this.password = password;
   }
}

messaging-config.xml - destination setup
<destination id="my_queue">

<properties>
<jms>
<destination-type>Queue</destination-type>
<message-type>javax.jms.ObjectMessage</message-type>
<connection-factory>java:ConnectionFactory</connection-factory>
<destination-jndi-name>queue/myQueue</destination-jndi-name>
<delivery-mode>NON_PERSISTENT</delivery-mode>
<message-priority>DEFAULT_PRIORITY</message-priority>
<preserve-jms-headers>"true"</preserve-jms-headers>
<acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
<max-producers>1</max-producers>
</jms>
</properties>
<channels>
<channel ref="my-streaming-amf"/>
         <channel ref="my-polling-amf"/>
</channels>

<adapter ref="jms"/>
</destination>

Application.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init(event)">

<mx:Script>
   <![CDATA[
      import mx.messaging.messages.AsyncMessage;
      import com.universalmind.model.vo.Person;
             
      private function init(e:Event):void{
       controlProducer.connect();

      }
      
      private function sendPerson():void{
       var personMsg:Person = new Person();
       personMsg.name = "Test User";
       personMsg.age = 30;
          personMsg.department = "Development";
       personMsg.password = "mypass";
       personMsg.username = "mylogin";
      
       var msg:AsyncMessage = new AsyncMessage();
       msg.body = personMsg;
       myProducer.send(msg);
      }
   ]]>
</mx:Script>

   
   <mx:Producer id="myProducer" destination="control_queue" />
   
   <mx:Button id="controlButton" label="Send Control Packet" click="sendPerson()"/>
</mx:Application>

Posted in Java | Flex | General | JMS | Universal Mind | 3 comments

Curl: First Impressions

June 13 2008 by Andrew Powell

A few days ago I was on a call with some sales people from Curl who were pitching us on their platform. I've sat on this a while because I wanted a chance to fully look into it and give it a fair shake. Having said and done that, I can say that I am not impressed.

One of the first points that the sales person made was something to the effect of "We're huge in Japan." That's all well and good, but the RIA market is much more than Japan. They claim to have been enabling RIA development since 1998. Not quite as long as Flash, but still not a new kid on the block either. OK, so far not too bad... Then someone stuck their foot in their mouth: The one thing that the sales person did that really pissed me off was basing their pitch on disparaging other technologies (Sliverlight and Flex). They claimed that Silverlight was "too late to the RIA party." Hello? Pot meet kettle? You may be big in Japan, but when it comes to mindshare amongst RIA developers, you're just as late, if not later than Microsoft to this party. At one point I had to stop these fellows and ask them to focus the discussion on what they can do, not what others can't do. Let's just say this isn't the best way to introduce me to your platform.

Seeing as this was going nowhere fast, I decided to look into it a bit more myself. Well, it turns out that to develop in Curl you need to learn yet another language. It looks a little like VB, a little like Java, but not totally. It's OO like AS3, but it's also got some elements to it that AS3 doesn't have yet (native 3D). This could be good or bad, take it for what it's worth.

If you want to get to remote data, you're pretty limited to web services or straight up XML. One of the not-so-hidden secrets to Flex's success is the binary remoting you get from AMF. This has really been a home run from the get go and we, as Flex developers, often overlook how valuable this can be in developing RIA apps. The lack of any kind of binary transfer is a major turn off, at least for me. Web services are bloated at best and useless at worst. If they want to improve this, the need to look at implementing AMF (open spec) or Hessian for some time of binary remoting.

I really think that the guys at Curl probbly mean well and have put a lot of good time and effort into their product. I just can't get myself over the image I have in my head of it being a scrappy MIT project that someone threw some VC at and tried to make it viable as a product. Really and truly, they are fighting an uphill battle against Adobe and Microsoft (same could have been said for a little company called Allaire a decade ago) with not much hope of breaking through the "big two" of RIA development. It's a good effort at an RIA platform, but in my opinion, not much more. Don't just take my word for it though: go to their site, take a look yourself, and form your own opinion.

Posted in ColdFusion | Flex | General | Air | 6 comments

IDE Bliss, or IntelliJ Kicks Ass

June 12 2008 by Andrew Powell

I know many of you in the Adobe world are big time Eclipse users. Flex Builder is in Eclipse, CFEclipse is there too. I must say however, that for doing just straight-up Java development, IntelliJ IDEA blows Eclipse out of the water. It is what an IDE should be. Unobtrusive when it needs to be, yet helpful when it should be. If you're doing any Java development at all, it's worth dropping a little extra coin to get a hold of what I think is one of the best IDEs around.

By the way... they currently have rudimentary Flex support, with more coming down the pipe for IntelliJ 8.0

Posted in Java | General | Spring | Hibernate | 2 comments

Is Open BlueDragon Losing Momentum?

June 08 2008 by Andrew Powell

I know this is purely speculation, but I have to wonder if that with resignation of Sean (angered by Vince et al .... again) and Mark ("defecting" to Railo), that OBD is losing momentum? Maybe I'm reading too much into these two resignations that came so close together. Still, I would think that two of their highest profile champions bailing out signals, at least to a lot of people who pay attention to the CF blogosphere, that something is not right with the ship. Maybe I am reading too much into this, or maybe it's all really becoming clear. I'll open it up to you: Is Open BlueDragon dying before it can really even get off the ground?

UPDATE: Since posting this, Andy Allan has also resigned.

UPDATE 2: Yet another person has resigned: Mike Brunt has also resigned the steering committee.

Posted in ColdFusion | General | Adobe | 9 comments