Thursday, June 12, 2008

 

Hello World with Jetfire

It has become a tradition the first program to introduce a user to a programming language is "Hello World". We thought it would be appropriate to have a "Hello World" program for Jetfire (download site) as well; however we were concerned that it didn't really show how Jetfire is different from everything else. Well that is the point. Jetfire it is not different when it comes to writting code to solve a problem, but it is radically different, in that it is a whole lot simpler, when you try to solve real world problems with Jetfire.

Well what do we mean by a lot simpler. Well lets look at "Hello World".

namespace test
{
workflow HelloWorld
{
DateTime creationTime = DateTime.Now;
public string Hello
{
get{return "This workflow was created at:" + creationTime.ToString();}
}
}
}

On the surface it looks almost like C#. The only significant difference is that 'class' has been replaced by 'workflow'. Other than that it is valid C# code.

So what is the difference? Why bother with Jetfire? Well the big difference is that Jetfire really starts where C# ends. For example, once a Jetfire instance of the HelloWorld object is created it is persistent until it is deleted. That is why there is a time stamp in this example so you could see when each instance was created. Try it for yourself.

In C# to make an object persistent you need to write code to save it to database or a file. Yes, you can serialize the object; however then serialization breaks if you change the code, and so on. With Jetfire there is nothing more to do. The objects and code are persitent. When the code changes a new version is automatically created.

This is part of goal of having the programmer focus on the problem, not the programming infrastructure. Hopefully the "HelloWorld" example gives some introductory insight to the features of Jetfire.

Labels: ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]