MDA And Software Factories – Separated At Birth?

Tonight I went to the monthly meeting of the local chapter of IASA. I should have also blogged this before the meeting, but I forgot. Sorry about that if you live near the Microsoft campus and wanted to go. Next meeting is on 3/30, so mark your calendars.

Anyway, tonight’s topic was an MDA workshop featuring AndroMDA. AndroMDA is an open source tool for generating primarily J2EE code for *nix boxes using UML and MDA. (To be fair, the speaker – local chapter president Chris Sterling – demonstrated generating C# code as well. Of course, he ran it under Mono on a Linux box.) This provided a great launching point for a general modeling discussion that helped me get a few things straight in my head. Typically, the UML vs. DSL discussion turns religious pretty quickly. However, I believe that people – like those a the meeting tonight – who are achieving practical success with MDA in the real world are doing so by using a Software Factories style approach.

First off, if you look at how most people use UML for MDA, the class diagram appears to be the most dominant model used. When I say “UML for MDA”, what I mean is people using UML as a blueprint or as a programming language. While UML has 12 different model types, class diagrams make up the bulk of the modeling effort. (The bulk of AndroMDA code generation works off the UML class diagram, though the BPM4Struts cartridge uses Use Case & State models as well) The other 11 diagrams are primarily used for sketching purposes. That means you’re only blueprinting the structural aspect of your system – which in turn means that all the system’s behavior has to be implemented by hand. Now, this is not to say that factories suggests you should only model the structural aspect of your system. However, I think this indicates that most pragmatic users have realized MDA doesn’t live up to the hype.

Secondly, the class diagram that are used have to be heavily adorned with custom metadata – typically in the form of stereotypes – in order to be useful for code generation (i.e. blueprint) purposes. AndroMDA has a set of “cartridges” (essentially, target code generators) such as EJB, Hibernate and POJOs. Each of these cartridges has a supported set of stereotypes. While there is some overlap (for example, EJB and Hibernate cartridges both define the Entity stereotype). These stereotypes assign brand new semantics to the elements being modeled. In short, they turn the the generic class modeler into a domain specific modeler!

It appears to me that the pragmatic MDA crowd is using the class diagram as a generic “ball and stick” editor. Model elements that aren’t needed are ignored and elements that are needed are added via stereotypes. For example, you can use a class diagram to model a database. Certain elements of the model are ignored (Can a column have protected visibility? Can one table inherit from another?) while other elements specific to the domain being modeled are added (primary and foreign keys, indexes, etc). The problem with this approach is that all of the knowledge of how to build a valid model is in the user’s head, rather than the tool. Typically, that means a lot of training as well as a lot of in depth understanding of the framework underlying the model in order to capture the right amount of information. Since all that domain specific information is trapped in the users head, they have to do a ton of menial drudge work. It’s different drudge work from things like writing tons of data access code, but it’s drudgery nonetheless.

If you’re going to need a tool specifically designed for your problem domain, why use a generic tool and a bunch of handwritten rules, when you can codify those rules into a domain specific language of your own? (I mean, other than the obvious “because the DSL Toolkit hasn’t shipped yet”)

Experimenting with Podcasting

So I’m playing around with podcasting. The new version of dasBlog supports RSS enclosures for local binaries and I’m thinking of adding support for remote binaries. (I’m not sure my friend who hosts this blog for me would appreciate the bandwidth spike from adding downloads of media files. Of course, that assumes people would listen). So far, I’m just listening. My friend Mike does his Manic Minute and I guess Daily Source Code is the defacto standard podcast. This will be easier when I get my new AUX input installed in my car.

Listening to 30 minute podcasts like DSC on my Nomad have me longing for WMP’s variable speed feature. I listen to podcasts primarily on my Nomad – the combination of WMP 10 AutoSync, Doppler Radio and Sean’s podcast playlists makes syncing down to my player effortless. But listening to Adam Curry ramble on about podcast commercialization for 45 minutes doesn’t fit into my communte. However, listening to Adam Curry sped up 1.4x would make a 45 minute show end in just over 30 minutes. But alas, the Nomad doesn’t have that feature. Does any player support that? Or does it take more proccessing power than these things are carrying around?

Note to MSTV Foundation team – variable speed support would also be a great feature for the DVR. I wouldn’t watch 24 sped up, but I might watch the Daily Show that way.

Update: I neglected to “give props” to my boss Norman for convincing me to look at this whole podcasting thing in the first place. Given how little spare time I have these days, I’m not sure that I needed yet another hobby. On the other hand, not following your boss’s suggestions or giving him props is never good for the career! 😄

NHL HDTV?

The NHL is also counting on the ever-growing popularity of high-definition television to boost TV ratings that are respectable on a regional basis but minuscule nationally. Both ESPN2 and NBC plan HDTV telecasts once the league returns, though ESPN2 first must pick up its options for the 2005-06 and 2006-07 seasons.

Hockey, like football, is well-suited for HDTV’s movie screen-like wide picture, which is five times sharper than conventional analog TV. The league is also excited about the ever-expanding acceptance of HDTV, which saw more than 1 million sets sold recently during the run-up to the Super Bowl.

[Associated Press: NHL looking at new rules, becoming HDTV-friendly]

At least we have something to look forward to I guess

24 Does Use A Three Act Structure

Sunday, I said that I didn’t think that 24 has a well defined three act structure. On further reflection, I’m not sure I was correct. I’m used to seeing these three act structure within a single episode and I don’t think most episodes of 24 follow that model. However, if you look at the season as a whole, it follows the three act structure pretty closely

[Note - as with Sunday, there some first season spoilers here - but again I'm avoiding the big ones. I also talk about the current season a bit at the end]

Typically, the three act structure divides the story into three parts – Setup, Confrontaion and Resolution. Each of these parts is deliniated with a plot point – some type of major reversal in the story. In a story as long as a season of 24, these reversals take a much more screen time than I’m used to. To take Star Wars as an example, the first reversal is when Luke discovers his parents have been murdered and he decides to go with Obi-Wan. That’s one scene – takes up a couple of minutes of screen time at most. But in 24, the first reversal is the last 20 minutes of Episode 6: Jack is comproised by the bad guys who have his daughter, it’s revealed that his wife is with one of the bad guys, the guy that kidnapped Jack’s daughter realizes what a bad situation he’s in and Palmer decides to tell the world about the death of his daughter’s rapist at the hands of his son that been covered up for seven years.

The second act is typically a series of cycles – alternating between story exposition and action. For example, the first cycle of the second act builds towards the attempt on Palmer’s life at the morning press conference. This goes on typically for half of the overall length of the story and ends in another reversal. To use Star Wars as an example again, the second act ends with our heroes returning to the rebel base with the Death Star’s plans while being tracked by the Empire. In 24, while the end of the first act ends is very clear and occurs exactly at the one quarter mark, act two runs a little long and has a muddier ending. Personally, I’d say it ends in the middle of episode 19, with Jack in the underground prison, realizing who the prisoner being kept there is while Palmer is realizing that he can’t trust his wife anymore.

Of course, the third act is where everything is resolved – typically running the final quarter of screen time. You can really see here the major difference between a format like 24 and a two hour movie. I don’t think you could reveal a twist as big as the one at the end of the next to last episode of 24′s first season in the last five minutes of a 2 hours movie and make it work. But that’s the time ratio – every minute of a two hours movie equals 12 minutes of a season of 24.

If you apply this same structure to the current season of 24, you realize that the we’re in the middle of act two right now.  The kidnapping and trial of the secretary of defense was act one – and again act one ends right at the end of episode 6. Jack and CTU realizes the “real” target is melting down nuclear power plant via the override device, Behrooz kills the man his father sent to kill him, Jack’s girlfriend’s estranged husband shows up and we realize there’s a mole inside CTU (I get the feeling this is a running plot point – the CTU spy. I’m guessing that if they’ve used that every season it’s gotta be pretty old by now). I put “real” in quotes because assuming this season follows the same pattern as season one, there will need to be some new “real” target in act three.

But I Don’t Think 18 Is A Catchy Title

Tanya pointed out the other day that having a DVR causes you to watch a lot more TV. Case in point: 24. I missed the first three seasons. I never knew when it was on and once you miss a single episode, you’re kinda done. Now that I have a DVR, I’ve haven’t missed any of season four. Furthermore, the first three seasons are available on DVD, so not only am I watching more TV from this season, I’m catching up on previous seasons. We just finished season one tonight.

[Note - there are some first season spoilers here - not big ones, but some nonetheless]

First off, there is alot of filler – at least in season one. There are long sequences (the girls escaping from the kidnappers leaps to mind) where there’s all this action and suspense, but everything ends up back where they started. Secondly, by the end I thought it was over the top on the amount of resources the bad guys had. I mean, they kidnap his daughter again? Maybe it bothered me more because I watched the whole season over a couple of weeks, instead of several months. Finally, the story flow really feels off – but that’s the nature of the real-time format. In a more typical series, there’s a slow build towards a final confrontation with a collection of connected yet distinct stories. But 24 is like a single 24 hour long movie, except that it doesn’t have a clearly defined 3 act structure. It kust puts the pedal to the metal at around episode four and doesn’t let up. That’s not as exciting as it sounds – stuff just happens…and keeps happening. There’s no time for reflection or anticipation which makes it much more difficult to enjoy the story.

I realize part of the show’s gimick is that it’s a full 24 hours. But really, I think the story – at least season one’s story – would have been better told in 14-18 hours. Of course, that won’t stop me from watching the current season or starting in on season two.