At the pre-conference workshops Steven Kelly, co-author of the book Domain-Specific Modeling: Enabling Full Code Generation, showed the attendees what domain specific modeling is, what the value is, a general way of how to do domain-specific modeling and how to do domain specific modeling with MetaEdit+. To get a rough idea of the workshop check out this presentation. For more than one attendee with a Microsoft background the workshop was a bit of a surprise. The domain specific tools of Microsoft were mentioned and discussed a bit but not more than that. The company of Steven Kelly, called MetaCase, has been doing domain specific modeling for a long time with great success. They have been doing this without any influences from Microsoft and probably in the near future Microsoft will borrow more of their ideas. Stuart Kent was a MetaEdit+ user before moving to Microsoft, and they have thankfully borrowed at least some ideas, e.g. terminology and concepts like Relationship, Role and Object, rather than reinventing the wheel. Steven Kelly wishes they had borrowed more, e.g. a true concept of Graph, n-ary relationships etc.

In the past modeling has been used by Case Tools that generated code. These tools were seeking the silver bullet in code generation. These case tools were arguably not very successful. Isn’t domain specific modeling just another case tool ? The big difference is in the domain specific part, each modeling language is only intended for one company and one problem domain. This means its concepts can be at a high level and precise, rather than so low-level, generic or vague that they can be used to describe anything. Similarly the code generator is made by the customer to produce the same kind of code already used by them in their implementations, rather than having a vendor-provided generator with verbose and clunky “one size fits all” code.

What is domain-specific modeling ? It is modeling that:

Captures domain knowledge (as opposed to code)

Raise abstraction from implementation world

Applies familiar domain concepts and rules as modeling constructs

Narrows down the design space to focus on a single range of products

Lets developers design products using domain terms

Apply familiar technology

Solve the RIGHT problems

Solve problems only once! (directly in models, not again by writing code, round-trip etc.)

At the workshop Steven Kelly showed fifteen real life cases that he and his company worked on. And even when you don’t have all the details and because of that would only believe half, the numbers are still impressive. Below is a mix-up of several noticed benefits of those different cases.

Comparison to hand-written java after first thirty products = DSM is 3 times faster with fewer errors

Development time for a feature from a week to a day

Creation of new services 6 times faster compared to manual practices

Code generation produces 100% of implementation

Generate all required artifacts from a single design (code, configuration, documentation)

Look at the picture at the top right corner (Software Productivity Research & Capers Jones, 2002)

During the workshop the participants were walked through and participated in creating a domain specific language for making interactive TV applications. This was done with MetaEdit+. MetaEdit+ is a very interesting piece of software.

Thinking up the domain experts concepts was the hard part. After that building the language and creating the generator and making a first model was very fast. One of the noticeable abilities was the ability to adjust the representation (while modeling) of parts of the model based on the relative positions of the parts programmatically. Is there a Microsoft product that is able to do this ?

A part of the way MetaEdit+ works is by the use of a domain framework. As a starting point, the code generated looks like the code the developers have written by hand so far. If large sections of that code are recognized as repetitive boilerplate, those multiple occurrences will initially be moved to be just one occurrence in the generator. However, if a section is more than a few lines it’s probably easiest to edit it outside the generator, so the IDE can offer syntax highlighting etc., so the repetitive code may well be moved into a separate function in its own file and just a call to that function will be left in the generator. Functions like that are what Steven Kelly calls the “domain framework”: new code components made by refactoring existing code during the process of creating the DSM solution. There’s not often much new code in the domain framework: code that already exists many times in hand-written apps, are taken and refactored so it appears just once.

When you want to use MetaEdit+ in an all Microsoft organization you have to keep some things in mind.

The user interface is not like most Microsoft products.

The generators are written in a language called MERL. Microsoft developers will need some time to get proficient with this language.

MetaEdit+ is a separate tool, not an add-in for Visual Studio. The generator can produce the code files and a new project file, or add them to an existing project. After some positive feedback from “Software Architect 2008” about a VS add-in, an add-in certainly has become a possibility.

But even when you take these points into consideration MetaEdit+ is definitely worth looking into

Great thanks goes out to Steven Kelly for commenting on and adding valuable context to this blog post. Hopefully he will not sue for plagiarism.

Still there is a need for defining an architect and defining architectures, the key note and some sessions started with definitions. For defining an architecture there are some pretty good definitions that most people can agree upon.

“The software architecture of a program or computing system is the structure or structures of the system, which comprise software elements the externally visible qualities of those elements, and the relationship among them.”

Len Bass, Paul Clements and Rick Kazman (SEI)

“All architecture is design but not all design is architecture. Architecture represents the significant design decisions that shape a system, where significant is measured by cost of change.”

Grady Booch

“The set of design decisions that, if made wrongly, causes your project to be cancelled”

Eoin Woods

“Architecture is the art of how to waste space.”

Philip Johnson

But when it comes to defining an architect the definitions are less clear and mostly boil down to a list of synonyms or a list of characteristics, skills or activities of an architect.

The characteristics could be distilled out of the key-note. Among other characteristics an architect needs to fight being human. An architect must fight the urge for

New and complex solutions (Fashion driven development)

Pursuing possible solutions too far

Just having faith (Faith based coding)

His own habits

Resolving every uncertainty right away (sometimes the right decision is to wait)

Most speakers did seem to agree on a certain skill set.

An architect needs street credibility

A relation to the code (preferably code himself)

Have the big picture to code detail

Cannot immerse in code completely

A solid technical background that isn’t just history

Communicator, appreciate other mindsets.

Needs design skills

Leadership skills

Coaching skills

One of things that was most prominent present was the need for architects to be more agile. Philippe Kruchten also held a session on the same topic on the 18th of june . This talk was an initiative by Logica’s guru4Pro and worthy of a blog post in itself. At the software architecture 2008 conference the message was clear. We need to be more agile to create more sustainable software and projects fail because we are not agile enough. To get an idea, watch the presentation from Kevlin Henney and James Coplien at infoq ( Agile Architecture is not Fragile Architecture ). What you could get from the conference, Philippe Kruchten and the presentation is:

On every project ask yourself: how much architecture do I need and how agile can I be to make this project a success !

In the key-note Kevlin Henney mentioned the Dreyfus Model of Skill Acquisition. This model recognizes five stages of skill acquisition.

Novice

Advanced Beginner

Competent

Proficient

Expert

According to Kevlin Henney at the novice level people try to learn the rules, when people start to be competent they start to bend the rules and finally the expert recognizes that the rules depend on the context. That is why when you a ask an expert architect a question, nine out of ten times the answer is “it depends“.

And yes, the answer always depends on the context.

Kevlin Henney mentions that the emphasis on context is mostly his own (as are his jokes!), as this comes from patterns, but some of the detail and framing has been inspired and influenced by Andy Hunt and Dave Thomas (the Pragmatic Programmers) and Dan North (better-best-practices).

Let’s make a step in becoming more of an expert in software architecture and recognize that also when :

It is an amazing reference guide with a lot of detail. This picture gives a great overview of what is in the book and where it is. Notice that what is outside of the circle, like ASP.Net, ADO.Net, WCF and WF is not covered by the book.

If you see through the advertising this overview gives a pretty good idea about the book.

If you are looking for a book to teach you how a computer program is put together this is not the book for you. It describes al the parts pretty well but it doesn’t describe putting them together.

You could read the book from cover to cover. This is mainly because a very easy to read writing style and a good build up of level of detail. But the sheer number of facts that follow each other in a very rapid pace doesn’t make it very useful to read it from cover to cover, after a while facts just want stick anymore.

I would suggest, skimming through the book behind a computer trying the interesting things you see and experiment with it. After that keep the book on your desk and use at as the great reference guide it is.