Smart Frameworks: Utalizing Rich Metadata and Code Generation, by Elliott Sprehn

Published February 2, 2007 on adamfortuna

    Notes from Elliott Sprehns talk on Smart Frameworks at Frameworks 2007. After 6 posts today I was starting to get a little spacey by the time this one came around. It was a great presentation though, and offered a lot of comparisons of coldfusion frameworks to Rails and what we can learn from them to make our lives easier, as well as how additional metadata in functions or arguments can help fill in the gaps in our metadata. With the Scaffolding BOF session either canceled or just empty (it is the end of the day on the last day after all), I headed to the Smart Frameworks presentation instead. One of the benefits of a framework is the ability to not repeat yourself. By centralizing your application logic in xml files you create a description of your application. This can be ported over to another language (besides coldfusion) because this is merely declaration of the application. We duplicate code all the time in frameworks. For instance in Transfer you create a column in a database, then add a property tag in the Transfer XML. Like wise in ModelGlue you declare the message listener and the function name in the controller. Although this decouples the message from the controller and the function, it might be overkill and duplicate information if you're not utalizing the message listeners to multiple function calls. Conventions come in handy! For instance in rails you have underscores in database column names, such as first_name. When this is translated to code, it would come out with a getFirstName function based on just that column name, and return the same thing everytime. Likewise in Model-Glue, you might have a needFirstName message that calls a getFirstName method. Metadata can be intrusive or non-intrusive. Non-intrusive metadata is stuff you don't have to think about. Intrusive metatdata on the other hand is awkward and not a standard. Configuration in this method is intrusive. It looks like a lot of the topics he's talking about- - search engine safe URLs that can be expanded on, no xml files, automatic mapping for requests and that kind of thing. It looks like a lot of the concepts he's mentioning are available in Coldfusion On Wheels .