Domain Specific Languages (DSL)

image I’ve been spending a lot of time recently looking at DSLs. That’s not on purpose, it’s just happened that way as I’ve been to a number of different conferences, such as Central Ohio Day of .NET where Jay Wren was talking about Boo and DSLs. I’ve also been in on a lot of discussions with Joe O’Brien and others about them.

From Martin Fowler – “The basic idea of a domain specific language (DSL) is a computer language that’s targeted to a particular kind of problem, rather than a general purpose language that’s aimed at any kind of software problem.”

There are a number of DSLs that we use every day. One of them that Joe likes to reference is:

Quad
venti
no whip
2 pump
white mocha

Obviously (hopefully), this is Starbucks’ DSL that they use. This is a very efficient way for the Starbucks employees to communicate. The cashier starts by taking the order and transmitting that order to the person working the espresso machine who fulfills the order and passes it on to the customer. I usually understand it when they hand it back to me even though it sounds little to nothing like what I said to the cashier in the first place.

Domain – Every Domain has a their own vocabulary and dialect. Think about the medical field, banking, real estate, investments, mathematics, zoology, chemistry, grocery stores and on and on. Everyone of these has a way of communicating that the outside world has to understand to understand them.

Specific – these vocabularies and dialects are specific to the domain that they are in. In fact, the various terms don’t transfer from domain to domain. As an example, if I’m say Prime to an investor vs. Prime to a butcher, they are going to have completely different ideas as to what I’m talking about.

Language – this specific vocabulary in each of these domains is about communication quickly and efficiently. It’s a language all unto itself. Now, the majority of these are created from within the languages that we speak on an every day basis – such as English or French. Some of them have a touch of Latin thrown in but for the most part, they are local centric.

In very much the same way, DSLs in the software world are created, typically, from a language that already exists. There are languages, such as BOO, where the point of the language is to make it easy to create DSLs. There are other languages, such as Ruby, that make it very easy to create DSLs (see Joe’s talk on referenced at the end of this post). This is one of many reasons that I’m geeked about IronRuby.

image It’s always a good thing when the programmers and the users are speaking the in the same languages. This makes sure that you’re in lock step on the requirements and what the application is supposed to do. I’ve seen time and time again where an application does exactly what the programmer intended for it to do but communications issues mean that they had no idea what the user actually wanted or needed.

The first time I was introduced to the topic was when I was writing banking software. We went through a lot of hoops to make sure that we were speaking in banking terms when talking to the business analysts (BA). This was a struggle for a lot of the compsci majors just out of college that were amazing programmers but couldn’t understand the business rules. Part of the problem was that the languages that we were writing in, while we had class and method names that mapped, was still the computer science language verses something that we could show the BA. I always wanted to make it a requirement that the programmers had to work as a teller for a week every couple of years so that they could understand the business. You think I’m joking, but Anheuser Busch makes all of it’s employees, from brewers to architects to executives go to brewing school. Dominoes Pizza makes everyone go through the line training to learn how the pizzas are made. There are a lot of these examples, but not nearly enough all at the same time.

We are getting the tools, however, at this point where the language that we write in can start to become the interface with the BAs and the users because we can write it in such a a way that they can understand it.

To get a fantastic primer on DSLs and see them created in Ruby, go watch Joe O’Brien‘s talk that he did at Mountain West Ruby Conf called Domain Specific Languages: Molding Ruby.

Other things to check out:

Martin Fowler on domain-specific languages
Creating Domain-Specific Languages

Central Ohio Day of .NET 2008 by Andy Erickson

I love it when the community steps up and really shows me something new. This past weekend I attended Central Ohio Day of .NET. This was one of the first events in a while that I’ve been to where I was just a participant. It was refreshing. As always, they did a fantastic job putting on the event and pulling together top notch speakers and content to really put together a solid show. Most of the day I was really torn between at least 2 if not 3 talks that I wanted to see. I was not surprised by that – that’s become the norm. Jim Holmes started the community conferences here in MI/OH/KY/TN (AKA Heartland District). That was picked up by Columbus and Ann Arbor who created the branding Day of .NET. That’s inspired a lot of other conferences around the district including Memphis, Grand Rapids, Cleveland and so on. Each of these have between 150 and 300 attendees. Those are anchored by the two huge community conferences, DevLink in the fall in Nashville at around 400-500 attendees and CodeMash which is a completely different animal.

image What I hadn’t seen before was what Andy Erickson put together. He put together a 5 minute video of the Central Ohio Day of .NET conference and really captured the event. Visit Central Ohio Day of .NET 2008 to see the video. He obviously put in some real work on this video. He even started a little bit of buzz about the event by interviewing some of the conference organizers such as Mike Wood. Listen to Mike Wood and Day of .NET ’08 for more on that. I really hope that more people will do this in the future. Even though I was there, there was a ton that I missed – like the fact that Michael Neel was there. Michael drove all the way up from Knoxville to Ohio to speak on the “Church of Agile“. It’s a fun and bizarre talk where he breaks out the Jedi garb and everything.

So, hats off to the organizers Jim Holmes, Mike Wood, Bob Sledge, Carey Payette and Justin Kohnen – they did an amazing job and I hope that they will continue to do so in the future.

West Michigan Day of .NET 2008Cleveland 2008Now I’m looking forward to speaking at the second annual West Michigan Day of .NET on May 10th, 2008. I’ll be speaking on Architecting a Rich Internet Application. Jay Wren is going to be doing his Boo and DSL talk. Wally McClure is coming all the way from Knoxville to do his deep dive into the ASP.NET AJAX panel. Michael Eaton is going to be speaking on LightReader, a Silverlight feed reader. Really, there are two many great sessions to list them all. Hope to see you there!

If you miss that one (or really, even if you don’t), you should try to make it to Cleveland Day of .NET! Again, they’ve got an amazing set of speakers and content. This is their first time but they’re coming out swinging. Unfortunately, I won’t be able to make that one personally but I’m hoping that someone will pull an Andy and catch me up on what I missed. :)

Definition of a Mashup

The JournalSince Larry Clarkin and I wrote the Enterprise Mashups article in the Architecture Journal, I’ve been getting a ton of questions about mashups and what they are. To that end, I thought I’d put my neck out and lay down a public definition.

A mashup is an application that pulls together data from different sources and puts that with functionality that didn’t know about each other previously to provide a interesting graphical look at that data.

Often, a mashup is used to the end of making decisions based on a visualization of the data.

The canonical example is putting data on a map. For example, Wikipedia (at least as of when I wrote this) defines it as follows:

In technology, a mashup is a web application that combines data from more than one source into a single integrated tool; an example is the use of cartographic data from Google Maps to add location information to real-estate data from Craigslist, thereby creating a new and distinct web service that was not originally provided by either source.

Mashup (web application hybrid) – Wikipedia, the free encyclopedia

However, it doesn’t have to be a map. It could be a graph, chart, mind map or any number of different overlays.

Now, notice that I didn’t talk about any given UI technology in my description. It could be AJAX. It could be Silverlight or Flex/Flash. It could be Java Applets. I’m not concerned about the exact technologies involved – just the overall idea that you are pulling together data with functionality with a UI none of which knew about each other before your “glue” code put them in the same room and let them dance.

Granny wants to Mashup?Things that are not mashups

Composite applications are not mashups. This is actually a funny one. Mashups are, by and large, composite applications. You can equate it to inheritance. Mashups have an IsA relationship with Composite Applications. However, the composite application that simply pulls together a number of different widgets each completely independent of the others on the page is not a mashup. So, what I’m saying here is that CAB Smart Parts, Sharepoint web parts and Java Portlets are not mashups – they are simply part of an overall application that has been assembled.

Aggregations are not mashups. I’ve been asked several times if aggregating 2+ RSS feeds or simply combining different data sources is a mashup. The reality is that it’s not.

If, on the other hand, you were pulling in 1+ RSS feeds and/or data sources and laying those out on a timeline or some different view of the data than just an aggregated list – then we are probably talking about a mashup. The key part here is that we are doing something more with the data than adding it together. We are enabling decisions to be made based on that data.

Tools to build mashups

You don’t actually need tooling to build a mashup. You could create it from scratch with a little bit of Javascript and a chart control. The most common mashup, as stated in the canonical example above, is a map with geographical data laid on it. Both Google Maps and Live Maps have SDKs that you can build on top of. Actually, the Live Map SDK has a completely interactive documentation set as you can play with that will let you try different things and copy source code right into your own applications. In a lot of ways, you can look at these maps as not only applications but mashup platforms.

Popfly and Yahoo! Pipes

Then there are more complete frameworks and platforms that will help you build mashups such as Popfly and and Yahoo! Pipes. These platforms allow you to drag and drop different data sources and apply logic and ultimately run that through a front end visualization. My 12 year old son has played with Popfly and created mashups with ease. Denny Boynton wrote a great post entitled “Is the Future of Popfly in the Enterprise?“. I think that he’s got something there.

One of the interesting parts about Yahoo! Pipes is that it allows you to pull in your data, build out your functionality and then at the end you produce it and have a tabbed view with a different visualization on each tab. That’s cool! If your data is geo tagged, then it will give you a map view. If you have numeric data, it will show you charts and so on.

Where to get started

There are a couple of ways to get started playing with mashups. First, you can take a look at Popfly and the like. Or you could get started with one of the online mapping applications/mashup platforms. However, if you are serious about mashups in your own company and want to produce mashups with your own data – you need to start by taking a long and hard look at your SOA strategy.

Are all of your services written because you needed to move the client to a different machine? Often you can tell these because they start to resemble your table names and fall into Ron Jacob‘s CRUDy Web Service Anti-Pattern. Unfortunately, this is the vast majority of applications that I’ve seen in the world that use web services. It’s just using web services rather than truly service enabling your platform.

Or are they strategically built services that encapsulate business logic? Are you thinking about your authentication and authorization strategies? Are you thinking about SOAP verses REST? Can you produce either from your platform?

These are all decisions that need to be made before you decide on the UI technology.

Organizing A Conference like Day of .Net

John Hopkins (who needs to blog more) wrote a fantastic article on how to run a community based conference. John is speaking from experience as he’s successfully run the Day of .NET two years in a row and he’s been on the board at CodeMash. I was on the organizing committee for both of these as well and can tell you that what John speaks is gospel.

I’m not going to rehash his whole article but to sum up a few points.

              • You can’t be too organized.
              • You can’t do it alone – you need as many volunteers as possible.
              • Venue is critical.

I will say that there are one or two tricks that you can employ that he didn’t think of. One of them is that there are a ton of registration services out there that run from a simple RSVP system to a full blown event engine. You really need some idea of how many people are coming so that you order the right amount of food, satisfy venders, stay safe on the fire codes and more. On the low end, you could just do a Upcoming, Facebook event or something like it with RSVPs. On the high end, you could go with an event company like EventBrite to do that for you. Or you could do what most of us morons do (And I’m including myself in this) and write your own registration engine for the show. This can come in handy if you actually include things like picking sessions that you’re interested in and the like.

He also didn’t talk about communications and such before the event. It was invaluable to have a collaboration site to stick notes, speaker abstracts, vendor contact and all that type of stuff. I’d recommend looking at BaseCampHQ and Sharepoint as possible collaboration implementations.

John’s advice has helped start and successfully run several conferences. It’s worth a read to go check out Organizing A Conference, especially if you’re planning to host a conference yourself.

340lbs Open Source BattleBot Malfunctions Nearly Maiming Microsoft…

I have been at MIX and SxSW the last two weeks. Or rather, I used SxSW as an excuse to come down for Whurley and Giavonni‘s BarcampAustin. It was amazing – I’ve never seen a barcamp done that well. Austin, the city,  declared the day BarCamp day. It was cool.

I did have a near death experience though and the guys at Viewzi.tv caught it all on film…

From Whurley

All went well save one small incident involving a 340lbs BattleBot malfunctioning and then taking off as fast as it could for the closet Microsoft employees. Thankfully no one was hurt or injured and they were amazingly good sports afterwards:

Many thanks to the folks at Viewzi.tv for the amazing editing job. And, yes we still love Brady and TeamDX! Good luck in the new season on ESPN guys!

Modern day bullfighting???

340lbs Open Source BattleBot Malfunctions Nearly Maiming Microsoft… — TalkBMC

MIX Day 1 Keynote Ray Ozzie

Ray OzzieRay Ozzie kicked off the MIX keynote by talking about the fantastic new things that have happened at Microsoft in the past year that are really re-engineering the DNA at Microsft from the acquisition of Aquantitive to the fantastic internal work with Silverlight 2.0 and IE8. As an employee in the trenches, it’s often hard to keep focus on that big picture and remember that the company is aggressively self critical and self correcting. Another great step we are trying to take, that Ray touched on a little bit, is acquiring Yahoo!. It’s interesting, but even in the field, I’ve seen that just the fact that we’ve made an offer has had a profound effect on a lot of people and is driving us into new and interesting directions. After that, he talk about the big picture and the directions that Microsoft is going with Services and Advertising and how that fits into the big picture of our S+S message. By Services, he’s talking about software services in the Cloud (internet/network) rather than consulting services.

The next huge point that he talked about is the idea of software above the level of a single device. Our users are starting to leverage intelligent devices of all types from phones to desktops to cars in every part of their lives. We need to look at how to really leverage the strengths of each of these devices and platforms.

There are 5 buckets that we can think about these services in the cloud.

  1. Connected Devices
    • The vision here is that we will have applications and services that span
  2. Connected Entertainment
    • The vision here is that we would only have to license our software and media once and be able to use that across all of our devices from our music player to our desktop or car. This is a great
  3. Connected Productivity
    • The vision here is that we will have a seemless experience from the desktop to the mobile device to the web with Office Desktop, Office Mobile and Office Live (web based).
  4. Connected Business
    • The start of the vision is a set of services from online CRM, financial services, hosted exchange, commutation services and even hosted SQL Server with an elastic type cloud supporting it. The long game is enabling utility computing in the enterprise where people will virtualize more and more of their infrastructure onsite and in the cloud.
  5. Connected Development
    • We have a ton of different scenarios that we can code to with the same skill set of .NET and XAML across many different platform. That’s exciting. 

Personally, I’m really excited to part of the company with an end to end vision that is as complete as the one that Ray was able to lay out today.

Technorati Tags: ,,,

Open Space | MIX08

Open Space

I’m going to MIX! And hope to see you there but it’s sold out so if you’re not already coming, I’ll see you next year. For those of you who are lucky enough to have tickets, we’ve got a lot of stuff going on and I’m actually involved in helping run what I think will be the coolest part… Drew Robbins successfully lobbied for an Open Space at MIX. Then he reached out to me, Tim Heuer and Peter Laudati to help him run it. I can’t tell you how much fun this is going to be!

If you want to participate, not just attend, but contribute to the conversation – this is place for you!

Clipped from the Open Space site on VisitMix.com.

New to MIX08 will be an Open Space area where attendees control the MIX conversation. Open Space is a way to bring together groups of people interested in a common topic to have an interactive discussion. In an Open Space session, there may be an expert who is passionate about a topic presenting to an audience or there may be a small group of people discussing an idea.

Four principles of Open Space:

  1. Whoever comes are the right people to be there
  2. Whatever happens is the only thing that could have happened
  3. Whenever it starts is the right time
  4. When it’s over, it’s over

Schedule facilitation and conversation recording will be provided. All you need to do is suggest the topics and participate. Submissions will be accepted onsite in the Sandbox starting Tuesday, March 4th from 4:00pm – 8:00pm and throughout the event. The schedule will be updated each evening and posted to the MIX website.

I want to propose topics about architectural patterns in RIA, REST verses Soap, common keyboard conventions and why more Web Applications don’t follow them and more. And I want your thoughts on these topics! Come pitch in and participate in the conversation.

What do you want to talk about?

Open Space | MIX08

What’s Central Region (my new territory) on Silverlight?

Continuing my thoughts from when Dan Hounshell asked me what’s my territory in response to my announcement about taking on the RIA Architect Evangelist Roll. I started thinking about the Virtual Earth map overlay and thinking it’s really not rich enough. So I thought I’d spend 15 minutes or so and slap together a Silverlight visualization of the Central Region…

Much of the map I cribbed from the Silverlight Airlines application because it was easy… :) I did spend some time cleaning up that XAML to have actual state names instead of some bizarre path name. I’m keeping that XAML for a lot of future fun.

*Key
Blue == Heartland District
Green == MidWest District
Orange == North Central District
Red == South Central District

I thought about just coloring the states but then that would be boring so I wrote a little bit of JavaScript to create the animation on the fly, attach it to the root and starting the animation. That’s how I got the glowing style effect on the states.

ShowState: function(control, stateName, colorName)
{
    var xaml =”<Storyboard x:Name=\”highlightState”+stateName +”\” xmlns:x=\”http://schemas.microsoft.com/winfx/2006/xaml\”>” +
       “<ColorAnimationUsingKeyFrames RepeatBehavior=\”Forever\” BeginTime=\”00:00:00\” Storyboard.TargetName=\””+stateName+
            “\” Storyboard.TargetProperty=\”(Shape.Fill).(SolidColorBrush.Color)\”>” +
            “<LinearColorKeyFrame KeyTime=\”00:00:00.0000000\” Value=\”” + colorName + “\”/>” +
            “<LinearColorKeyFrame KeyTime=\”00:00:01.0000000\” Value=\”Dark” + colorName + “\”/>” +
            “<LinearColorKeyFrame KeyTime=\”00:00:02.0000000\” Value=\”” + colorName + “\”/>” +
        “</ColorAnimationUsingKeyFrames>” +
    “</Storyboard>”

    var animation = control.content.createFromXaml(xaml);
    var root = control.content.findName(“Page”);  
    root.Resources.Add(animation);

    animation.begin();
},

The other relevant code is the resizing code.

In the load, we create and add the transform to the root element that does a ScaleTransform (read resizing transformation). The other useful thing that this function does is that it wires up the resize event handler.

    handleLoad: function(control, userContext, rootElement)
    {
        this.control = control;

        _silverlightControl = control;

        var rootCanvas = rootElement.findName(“Page”);
        if (rootCanvas) {
            _originalWidth = rootCanvas.width;
            _originalHeight = rootCanvas.height;

            rootCanvas.renderTransform = _silverlightControl.content.createFromXaml(‘<TransformGroup><ScaleTransform Name=”rootScaleTransform” ScaleX=”1″ ScaleY=”1″ /><TranslateTransform Name=”rootTranslateTransform” X=”0″ Y=”0″ /></TransformGroup>’);
            _rootScaleTransform = _silverlightControl.content.findName(“rootScaleTransform”);
            _rootTranslateTransform = _silverlightControl.content.findName(“rootTranslateTransform”);
        }

       //Wire up onResize EventHandler
        _silverlightControl.content.onResize = this.handleResize;
        this.handleResize();
        this.ShowStates(control, rootElement);
    },

After that, we listen for the resize and do the appropriate math to scale the transformation to the right size. This is cool because as we resize the root element, it will automatically take care of it’s children for us.

handleResize: function(sender, eventArgs)
{
    // Capture the current width/height
    var currentWidth = _silverlightControl.content.ActualWidth;
    var currentHeight = _silverlightControl.content.ActualHeight;

    if (_rootScaleTransform && _rootTranslateTransform && _originalWidth && _originalHeight) {
        // Scale the root Canvas to fit within the current control size
        var uniformScaleAmount = Math.min((currentWidth / _originalWidth), (currentHeight / _originalHeight));
        _rootScaleTransform.scaleX = uniformScaleAmount;
        _rootScaleTransform.scaleY = uniformScaleAmount;

        // Translate the root Canvas to center horizontally
        var scaledWidth = _originalWidth * uniformScaleAmount;
        _rootTranslateTransform.x = (currentWidth – scaledWidth) / 2;
        // var scaledHeight = _originalHeight * uniformScaleAmount;
        // _rootTranslateTransform.y = (currentHeight – scaledHeight) / 2;
    }
}

So, understand the central region’s boundaries now?

What’s Central Region (my new territory) on Virtual Earth/Live Maps?

Where is ... ?Dan Hounshell asked me what’s my territory in response to my announcement about taking on the RIA Architect Evangelist Roll. I thought about just typing out the response, but then I realized that that would be very un-RIA of me and it would, as many standard HTML pages do, fail to really help people visualize where I’m working.

The first one that I thought of was a Virtual Earth map overlay. I used to think these were hard until Larry Clarkin showed me how easy these were to do. I’ll be doing a lot of these over time as I start doing mashups for events and the like. The hope is to start doing a GeoRSS feed at some point that will have a list of events that I’ll be at, where to find registration and the like. This has been in the plans for quite a while, the questions where to host it and the like are interfering with progress.

However, for right now, I’m just going to do the simple layer over Virtual Earth to show you the Central Region.

This was relatively simple to do. All of the code that you need to get started can be found on the Interactive SDK which makes this the best documented API I’ve seen Microsoft produce.

This is the code that I wrote. Notice the “…” which means that there’s about another 20 lines of those to make the central region shape. The hardest part of this one was getting all the latitude/longitudes right. I didn’t get it perfect but it’s close.

function AddCentralRegion()
{
var fillColor = new VEColor(0,0,255,0.2); //Transparent Blue

var centralRegion = new VEShape(VEShapeType.Polygon,
    [new VELatLong(48.99989069893174, -104.04843181371691),//    North West Corner
    new VELatLong(41.0017229451484, -104.05321687459947),
    new VELatLong(41.00233021312762, -102.05171227455139), //KS NW Corner

    new VELatLong(49.38326680201004, -95.15361785888673),
    new VELatLong(48.998803197833915, -95.15284538269043)
    ]);

    AddShape(centralRegion, fillColor);
    map.SetCenterAndZoom(new VELatLong(38.47939467327643, -90.087890625), 4);
}

function AddShape(shape, fillColor)
{
shape.HideIcon(); //Don’t need the pushpin
//Set the line color
var lineColor = new VEColor(0,0,0,1.0); //Black
shape.SetLineColor(lineColor);
//Set the line width
var lineWidth = Math.round(1);
shape.SetLineWidth(lineWidth);
//Set the fill color
shape.SetFillColor(fillColor);
//Set the info box
map.ClearInfoBoxStyles();
shape.SetTitle(“<h2>Heartland</h2>”);
shape.SetDescription(“<div>Heartland District</div>”);
//Add the shape the the map
map.AddShape(shape);
}

One small frustration was that I couldn’t figure out the JavaScript ordering and whatnot to get it to embed nicely in a blogpost. It really wants the call to load the map to be in the body’s onload call because that happens after the rest of the HTML has been loaded and rendered. That’s a little annoying and I’m going to figure out the issue and post a fix soon.

Technorati Tags: ,,

My New Position at the Central Region RIA Architect Evangelist

New logo for Ria

It really couldn’t come at a better time with MIX and SxSW coming up so soon. I’m moving into a new role as the Central Region Rich Internet Application Architect Evangelist. I’m leaving the Heartland in the VERY capable hands of Brian Prince. (See his announcement called Farewell)

So, what does that mean?

I’m going to be broadening my geography and focusing in on a technology stack. I’ll be covering all of the center of the United States with a heavy focus on Rich Internet Applications and partners.

In this technical and business development role,I get the opportunity to combine my passion for Rich Internet Applications and pragmatic business experience to help consulting shops, design firms and customers in their pursuit of the Microsoft stack in the web space.  That includes broad  responsibility for evangelizing the complete Microsoft platform with heavy emphasis on Silverlight, .NET Framework, Visual Studio, Expression, and ASP.NET AJAX. 

clip_image001

I’ve been asked by a lot of my friends that I’ve made over the past year at Microsoft if I’m abandoning Heartland and if they are going to see me again. This is the typical pattern where someone does well as an evangelist and then moves off to Redmond and nobody sees them again. That’s not the case here. I’m staying in Michigan. I’m not moving to Redmond and don’t have plans for for the foreseeable future. I am tightening my focus so I’m not going to be all over the District covering anything and everything Microsoft related. However, I will be heavily involved in helping grow the community and partners that are in my chosen technology stack. Actually, a lot of my job will be business development with my partners so I will be seeing (or at least communicating with) a lot of you a lot more often.

Most people that I’ve talked to have said that it makes sense for me as most of my posts and activities lately have been in this realm anyway. I’m just officially getting permission to follow my passions and do the work that I want to do. I’ll be working very closely with Chris Bernard, Don Burnett, Jeff Blankenburg, Larry Clarkin, Adam Kinney, Scott Barnes and more! It also means that I’ll get to more things like the Phizzpop Design Challenge only I’m hoping to bring my own flair to them now that it’s officially part of my job.

If you have any questions at all or would like to work with me on something, feel free to email me at myfirstname.lastname (at) myplaceofemployment.com – please read that and decipher as my first name is Josh, last is Holmes and I work at Microsoft. :)