Nov 19, 2009

.NET or ColdFusion ?

Umm why not both?

I think having an understanding of multiple languages is a good thing. Before working with ColdFusion my preferred web language was PHP. At that time I was also writing some thick clients in VB.NET I still like to work with other languages and recently I have been brushing up on C#.

So what's the point of learning languages if your not going to use them? Well occasionally you do and it can really come in handy. Recently I worked on a project that had some pre-built code in c# and they needed a Web interface to part of there system. As alot of the processing was already built in .NET I took what I needed compiled it to a dll and just invoked that from ColdFusion ( yeah fancy that a shop that had both .NET and CF ).

This is a handy feature of ColdFusion 8 and 9 and we rarely see any examples or mentions of this.

I made this quick demo to show how you can pass some simple data to and from .NET from CF.

Yes it's alot of code for a 4 line cfquery but it's just a demo.

.NET Code


CF Code:



Result:

4 comments:

  1. Hi Paul,

    If you're really interested in CFML and ASP.NET integration, you should take a look at BlueDragon.NET:

    http://www.newatlanta.com/products/bluedragon/index.cfm

    You might also be interested in a series of blog entries I wrote comparing performance and compatibility between BlueDragon.NET and CF8:

    http://blog.newatlanta.com/index.cfm/2008/8/27/BlueDragonNET-versus-ColdFusion-8-NET-Integration-Performance

    http://blog.newatlanta.com/index.cfm/2008/9/19/BlueDragonNET-versus-ColdFusion-8-NET-Integration-Compatibility

    I haven't done any testing with CF9, but I assume it hasn't changed much since CF8 regarding .NET integration.

    (BTW, I assume you're also aware that BlueDragon.NET has been powering MySpace.com--the world's largest CFML site--since 2005.)
    ReplyDelete
  2. Interesting. We are significantly investing in Adobe ColdFusion especially due in part to the tight integration with Flex.

    It's not often I use both CF and .NET in the same project I just wanted to share some examples.

    I've actually been playing with cfgroovy and merging several languages into a single cfm and I think this goes to show how versatile cfml is regardless of the engine.
    ReplyDelete
  3. Good blog post. I'm ALWAYS an advocate of learning/using multiple languages. Great way to get new perspective and find new techniques Good job Paul!
    ReplyDelete
  4. Great demo Paul! It'll certainly come in handy if I need to do any .NET integration.

    It made me laugh to see C# taking 42 lines of code to do one cfquery. I guess the nice thing is that all subsequent sql statements in your dll would only take about 20 lines of code. wink
    ReplyDelete