Thursday, June 28, 2012

Hessian Binary Web Service Protocol

I want write about hessian project. It is a binary web service protocol and open source project. I will explain it with a sample code. I will use it with java servlet technology.

First you have to define a common interface: Let's call it HessianService. Then, you define a servlet in server side which implements this common interface you define and also extends com.caucho.hessian.server.HessianServlet . You can access this servlet on client side with the help of the common interface.

common interface :


server side :


client side :


references : http://hessian.caucho.com/

Wednesday, June 27, 2012

Are you ready for Eclipse 4? Eclipse Juno is released!!!

This is a big day for Eclipse Community. Eclipse release train has moved to the next major version after Eclipse 3 release in 2004. Eclipse 4.2 Juno has just been released after 4 years of effort. Juno represents the work of 72 project teams by 445 open source committers on 55 million lines of code, and the participation of 40+ Eclipse member companies.


You can download the Juno from eclipse.org download page: http://www.eclipse.org/downloads/

To get more information about Juno and its new features, I advice you to read thefollowing articles:
- "Top 10 Eclipse Juno Features" by Ian Bull in EclipseSource.com
- "Top 5 Reasons Why You Need Eclipse Juno" by Chris Mayer in JaxEnter.com
- "Eclipse Juno and the Future of the Eclipse Platform" by Alex Blewitt in infoq.com
- "Eclipse Juno Brings Eclipse 4 as Standard" by Alex Blewitt in infoq.com
- "Eclipse Code Recommenders Proposes Code Based On Bayesian Networks" by Alex Blewitt in infoq.com
And don't miss the Java Tech Journal's latest issue focused on Eclipse Juno : http://jaxenter.com/java-tech-journal/JTJ-2012-05

Eclipse Juno has some great features, such as a new platform with a new workbench UI model, JDT enhancements, whole new look of workbench, detached editors, universal search bar, and of course "code recommenders" plugin.

Eclipse Code Recommenders

Eclipse Code Recommenders is a new plugin you can install that analyzes code of existing applications, extracts common patterns of how other developers used and extended certain APIs before, and re-integrates this knowledge back into your IDE.


Code Recommenders must first be configured with a knowledge base (Model Repository Reference). Using this knowledge, code recommenders can take a complex content assist and display a much more civilized list, based on common usage patterns.


Tuesday, June 26, 2012

Easy Finite State Machine Implementation with Apache Commons SCXML

This article mentions about Finite State Machines (FSM), SCXML (State Chart extensible Markup Language)  and Apache Common's SCXML library. A basic ATM finite state machine sample code is also provided with the article.

Finite State Machines:

You probably remember Finite State Machines from your Computer Science courses. FSMs are used to design computer programs or digital circuits.

A sample Finite State Machine [2]

A FSM is simply an abstract machine that can be in one of a finite number of states.The machine is in only one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition, this is called a transition. A particular FSM is defined by a list of the possible transition states from each current state, and the triggering condition for each transition. [1]

SCXML Language:

A working draft called SCXML (State Machine Notation for Control Abstraction, published by W3C) can be used to describe complex state machines. SCXML is a general-purpose xml-based state machine language. It is still a draft and latest version is 16 February 2012. Click here to get five minute introduction to SCXML documents.

Apache Commons SCXML Library:

Apache has an implementation aimed at creating and maintaining a Java SCXML engine capable of executing a state machine defined using a SCXML document, while abstracting out the environment interfaces. The latest stable version is 0.9.
Library Website: http://commons.apache.org/scxml/index.html
Eclipse Plugin: http://commons.apache.org/sandbox/gsoc/2010/scxml-eclipse/ (still under development)
UseCases: http://commons.apache.org/scxml/usecases.html
SCXML Editors:

Apache's Eclipse Plugin aims to provide a visual editor to edit SCXML files but it is still under development. There is also scxml gui ( http://code.google.com/p/scxmlgui/ ) which is very successful. You can also check State Forge's visual State Machine Diagram :  http://www.stateforge.com/StateMachineDiagram/StateMachineDiagram.html