Porting an FB4/MVC ColdFusion Application to ASP.NET
We’re building a prototype application based on an existing CF app, a move primarily driven by the need for a more refined/elegant front end as well as the need to command greater ‘respect’ (for want of a better word). Let’s face it: an ASP.NET app written in C# is seen by most business people and (most formally trained) developers alike as being more professional. One can argue all day about the merits of such a statement, but for our needs, it is the case. When a potential investor hears “C#,” it lends more credibility than hearing “ColdFusion” does. If the prototype goes smoothly, my guess is that we’ll move to .NET pretty quickly.
And with regard to the nicer front end, yes, you can certainly make a nice front end with Flash, or DHTML, but that’s just messier and more involved than we care to be with the front end code. Take a company like Telerik, who produce a very impressive suite of controls for .NET. They’ve recently released ‘callback’ controls (as opposed to postback) which are essentially AJAX controls. And all the clientside work is done for you. No fiddling around with DHTML all day. Take this code for example which demonstrates how to load the child nodes of a parent node by using the built in controls event handler.
RadTreeNode rootNode = new RadTreeNode();
rootNode.ID = SomeUniqueID;
rootNode.Text = "Root Node 1";
rootNode.ExpandMode = ExpandMode.ServerSideCallBack;
private void RadTree1_NodeExpand(object o, Telerik.WebControls.RadTreeNodeEventArgs e)
{
string nodeID = e.NodeClicked.ID;
string nodeText = e.NodeClicked.Text;
string nodeValue= e.NodeClicked.Value
...
}
There is a good bit of code left out here, but the point here is that using a control like this allows you to focus on your business model and not have to worry so much about the nitty gritty stuff. You simply drag a treeview control onto your screen and your in business. You can now develop an AJAX application using the built-in event model as you did before. This one line:
rootNode.ExpandMode = ExpandMode.ServerSideCallBack;
which sets the ExpandMode property of the of the rootNode cahnges your control from ‘postback’ (which refreshes the page) to ‘callback’ (an asynch call, with no page refresh)
Maybe it’s me, but you don’t find controls (from comparable 3rd party vendors) like this in the PHP or CF world.
Anyway, the front end stuff is really just once piece of the puzzle. Beyond the front end enhancements, a move to .NET opens the door to other possibilities such as a desktop piece using Windows Forms, and some tighter integration with other software vendors and ultimately a more pure OO business model.
And just how easy is it to re-write a Fusebox app in C#? We’ll find out. Our FB app is fairly OO in its approach, so we are in fairly good shape, I think. I plan to write more about the process as it unfolds. I’m sure the port is, like so many other things, easier said than done. More to come..
Post a Comment