Monday, November 22, 2004

Introducing Galvanium Framework

Galvanium Framework
Introduction
Integrating.NET with J2EE via Web Service framework may encounter something that is not smooth. For example, Axis cannot serialize java.util.List, and this type of collection cannot be consumed, directly, by .NET. Moreover, using Web Services to interoperate in LAN dramatically decreases performance of the system.

Hessian protocol introduced by Caucho Technogy is a kind of binary transportation over HTTP. Its Java implementation as Servlet provides lightweight communication comparing to SOAP. Hessian came with a complete set of serializers/deserializers that work smoothly for Java types. Additionally, it is small enough to be compiled with IKVM, and used in the .NET side via IKVM runtime. Using IKVM and Hessian lead to a fast and flexible way to interoperate .NET with Java. It eliminates a lot of type mapping issues, and works through firewall.

Galvanium framework is built on this idea, plus the get/set simulator of Java Bean for .NET. The get/set simulator utilizes the data binding feature of .NET to display data from enterprise J2EE backend in .NET GUI.

Features

  • Fast, and Lightweight Protocol
  • Seamless Integration of J2EE objects and .NET GUI
  • Direct .NET/Java type mapping
  • Display/Edit Java objects in Databinding Controls of .NET
  • Works behind Firewall
  • Support Mock Object technique via ClientProxyFactory

Components
  • ClientProxyFactory
  • BeanDescriptor
  • BeanCollection
  • GxControl

Software Architecture


License
Galvanium Framework itself is ASF's Apache License 2.0. However, if it is used by GxControl which is based on MyXaml, it will be GPLed.

Download
Galvanium framework is hosted as a part of BoldSoap project. It can be donwloaded form SourceForge’s CVS repository.

cvs -d:pserver:anonymous@cvs.sourceforge.net:
/cvsroot/boldsoapserver login

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:
/cvsroot/boldsoapserver co galvanium

Friday, November 19, 2004

Hessian Client for .NET

In order to interoperate with J2EE, I port Hessian (client classes) to be .NET library.

Hessian is small, and not complex enough to be compiled with IKVM. After removing its server-side part, and working around regarding GNU Classpath's URLConnection bug, Hessian works for me from .NET side. This library will be used as a transport to communicate with JBoss, and Hibernate. I'll have a complete tutorial soon.

Surely, my GUI client is scritable MyXaml :)

Tuesday, November 16, 2004

Expose Single Bean

Again with Java-style Bean properties in .NET. Now I have a class to help one exposing Jave setter/getter as a .NET property.

For example, I have a bean:


public class Bean {
private string _name;
public string getName() {
return _name;
}
public void setName(string value) {
_name = value;
}
}


I can expose a single Bean to the Text property of a TextBox txtTestProp using the BeanDescriptor as follows:


Bean b = new Bean();
b.setName("ck");
BeanDescriptor bd = new BeanDescriptor(b);
txtTestProp.DataBindings.Add("Text", bd, "Name");


Sunday, November 14, 2004

Scriptable MyXaml with NVelocity

I'm very impressed by MyXaml at first sight. Creating GUI with its declarative programming style is very useful for me. My idea is to generate .NET GUI of Hibernate's Beans via reflection (see last post). After surveying some template generators, I've found CodeSmith, TahoGen, and NVelocity. I've selected NVelocity because it's under Apache license. CodeSmith cannot be distributed with MyXaml (because of it's GPLed). Alternatively, you can wait for TahoGen. But now I have a working .NET UserControl of MyXaml that dynamic. :)

Here is a screenshot(click to enlarge):




Code snippet:


<GroupBox def:Name="grpNavBar" Text="test"
Location="8,8" Size="150,150">
<Controls>
#foreach ( $item in [1..3] )
#set( $loc = $item * 25)
<LinkLabel def:Name="lnkTest${item}"
Text="test" Location="8, $loc"
Tag="Test" />
#end
</Controls>
</GroupBox>

Tuesday, November 09, 2004

Java Bean-style Property binding in .NET

I have a problem with the Bean properties when I use .NET classes (of Java Beans) that are compiled by IKVM. Searching with google for a few days, I found some sources that describe how to create custom property descriptors. Now I have my beans working with .NET databinding. This is a Bean-style class that I've used in testing:


public class Bean {
private string name;
public Bean() {
}
public string getName(){
return name;
}
public void setName(string value) {
name = value;
}
}


In the code below, BeanCollection is the class that implements ITypedList to simulate Bean getter/setter.


private void button1_Click(object sender,
EventArgs e) {
Bean[] b = new Bean[2];
b[0] = new Bean();
b[0].setName("hello");
b[1] = new Bean();
b[1].setName("Bean Binding in C#");
BeanCollection c;
c = new BeanCollection(b, typeof(Bean));
listBox1.DataSource = c;
listBox1.DisplayMember = "Name";
textBox1.DataBindings.Add("Text", c, "Name");
}


Here is the screenshot:



Friday, October 29, 2004

Dependency Injective Service Gateway

I introduce a new pattern to extend Service Gateway pattern.
This pattern help aggregating Web Services, and is implemented in my BoldSoap framework.
It optionally supports Aspect weaving.

As you might see in the figure below, this pattern consists of 4 main actors, Configuration, ServiceFactory, SkeletonInterface and GeneratedClass,

  1. ServiceFactory; it's the BeanFactory class in BoldSoap framework 0.1. The implementation is based on Javassist.
  2. GeneratedClass; this is runtime auto-generated anonymous class based on mapping information in the Configuration.
  3. SkeletonInterface; it's a reference interface that will be wrapped by GeneratedClass
  4. Configuration; the XML configuration that maps several WSDLs into the single access point (defined by SkeletonInterface)


Dependency Injective Service Gateway Pattern


Tuesday, October 05, 2004

BoldSoap framework

I'm now working on BoldSoap framework, a soaplet engine that utilizes XPath.
BoldSoap is inspired by Soaplet library of Dan Diephouse .
But I've found that his code doesn't work for me.
I need a soaplet to work with the complex type. Thus, I start coding BoldSoap.

I've hacked the Axis's client and cut some codes to make its Call class working with XPath.
BoldSoap is now using Dom4J as its XPath engine. (redundancy I know :))

BoldSoap 0.1 Features

  • Generate Call from WSDL (using DynamicInvoker code from Axis client)
  • Detect Soap Endpoint from WSDL
  • Set parameter with XPath expression
  • Get result with XPath expression
You can see BoldSoap framework on SourceForge.

As I mentioned about Peepthong framework last blog, it will be built on the top of BoldSoap soaplet.

Peepthong Framework

I'd like to introduce a Web Services integration framework using the interface-based aspect weaving technique with the dependency injection pattern.
My initial implementation is being done with Java, and it's called Peepthong framework.

This framework will be hosted on SUT as I'm a lecturer at its School of Computer Engineering.

The interface-based aspect weaving is my research work that this framework bases on.
It a subset of aspect-oriented programming (AOP) weaving. My technique consider the skeletons of an interface as joinpoints, and an aspect will be woven into the auto generated class that implements the interface.

In Peepthong Framework, a generated class is described by an XML mapping file that contain some integration informatiom of one or more Web Services together. Using this framework will allow you to access services that have different interfaces (or WSDL) from a single access point.

Idea and code behind this framework are from:

  • Spring framework
  • Javassist
  • Apache Axis
  • Apache WSIF
  • Codehaus Soaplet
  • Codehaus Xfire
  • XPath