Application Generation

Musings on DSLs, DSM, Agile, SPLs and CFML by Peter Bell

Deck from RIA Unleashed

with 5 comments

Here’s the deck from my presentation at RIA Unleashed in Boston on Friday of last week on RAD OO. I started off with introducing the IBO (my implementation is now actually a separate iterator which you load a business object and a recordset into) and then moved onto base classes, optional classes, XML DSLs and custom data types.

As Jason Delmore pointed out after the presentation, the IBO/iterator pattern is going to become less common as more people start using Hibernate, so I may pull it from future presentations even though I’m going to continue to use it as for me my data mapper is a better fit than Hibernate (for running lots of little sites on a single server).

I’m really happy the way that RAD OO is starting to become a good intro to DSLs in ColdFusion. I’m also looking at how I could pull out my DSL code from LightBase and open source that (LightDSL, perhaps) so that people would have a code base to start with for their explorations, but given my current schedule, it’ll probably be cf.Objective() next year before I’ll be able to get that done.

Great to meet old friends and new. Only sorry I couldn’t hang around longer to catch the drinks in the evening. Many thanks to Brian Rinaldi for doing such a great job organizing the event!

Written by peterbell

November 16, 2009 at 10:49 am

Posted in Conferences

5 Responses

Subscribe to comments with RSS.

  1. Great presentation Peter! I was also wondering where Hibernate would fit into the picture, this post clarifies that. The DSL seemed to be the most powerful component, and I began thinking of a way to possibly implement that sort of functionality into a CF Builder extension …

    Seth

    November 16, 2009 at 11:12 am

    • Yep. Although I think that it’s important to realize that Hibernate doesn’t come for free. There is quite a bit of voodoo involved in getting your caching strategies right for Hibernate and I’d be interested to see how it would work hosting (say) 50 websites each with its own Hibernate session on a single regular server. One of the reasons I didn’t port to Grails was because it’s not really designed to run lots of little apps on a single box – one of the things I need to be able to do.

      But the DSL part is really the main part of the presentation. Base classes, optional class files, XML DSLs and custom data types are the areas that provide the most value. The IBO is really for people who’re not ready for that yet but want to start using objects more consistently in their applications.

      peterbell

      November 16, 2009 at 11:16 am

      • Hi Peter,

        Can you expand on your Custom Data Type convention? I cannot seem to wrap my head around how you are implementing these? It sounds like you would have, for instance, a Display() method and the arguments would be of a type=”com.datatypes.emailAddress” etc. and then the dt cfc would have formatting options??? Am I close? Could you share a snippet as to how you do that w/o giving away anything that you deem proprietary?

        Thanks,
        Andy

        Andrew

        November 16, 2009 at 5:01 pm

  2. Hi Andy,

    All of my business objects extend a basebusinessObject with format(), field() and processField() methods. They all call a singleton injected into the base business object called dataTypeFacade, and that has all of the data type cfc’s (money, date, wysiwyg, URL, etc) loaded into it as singletons. It gets passed the property name, the property value (or the event object for processing forms), the data type, and any format override data (I want to use a fileupload data type, but want to limit it to pdf’s and upload them into /special/folder) and it handles the processing.

    Sample (simplistic) data type cfc:

    // ***************** CONSTRUCTOR *****************
    function init() {
    super.init();
    addDefault( “symbol” , “$” );
    return THIS;
    }

    // ***************** PUBLIC METHODS *****************

    function field( PropertyName , PropertyValue , DataTypeProperties ) {
    var Properties = ProcessDataTypeProperties( arguments.DataTypeProperties );
    return “#Properties.symbol# “;
    }

    function format( PropertyName , PropertyValue , DataTypeProperties ) {
    var Properties = ProcessDataTypeProperties( arguments.DataTypeProperties );
    return “#Properties.symbol# #Numberformat( arguments.PropertyValue , ‘9.99′ )#”;
    }

    function processField( PropertyName , Event , DataTypeProperties ) {
    var Properties = ProcessDataTypeProperties( arguments.DataTypeProperties );
    var FieldValue = trim( arguments.Event.get( PropertyName ) );
    if ( not len( FieldValue ) ) { FieldValue = 0; };
    return FieldValue;
    }

    peterbell

    November 17, 2009 at 11:34 am

  3. [...] RIA Unleashed deck [...]


Leave a Reply