Wednesday, May 06, 2009

model interoperability in virtual design and construction


A couple of weeks ago, I presented a paper at the Knowledge Industry Survival Strategy (KISS) workshop (associated with the ASWEC conference) on the Gold Coast. The conference was about interoperability in domain-specific languages. Our paper (it was written with Professor Robin Drogemuller) was on the IFC language, the standardised language for interoperability in Architecture/Engineering/Construction software, including CAD tools, and on how it performs as an interoperability language. IFC, which I have been working with now for about 16 months, is comfortably the biggest metamodel I have seen or heard of (much bigger than, for example, CWM or UML2), certainly the broadest and among the most complex. The models are enormous - the example I present in the paper included 7.3 computational objects - and also very complex. It is a compelling example of a DSL.

The paper and presentation were very well received, and were singled out for mention in the call for submissions for the followup workshops at Code Generation and ASE. We also got a mention on the website and newsletter of the CRC for Construction Innovation, under whose auspices were conducted the projects that lead to the observations in the paper.

The paper and slides are up on the workshop website,

Monday, October 13, 2008

steal this blog post.

From the book of xkcd. Amen.

(You really can steal my blog post, but you should say you did.)

refactoring EMF models

I'm a software engineer now (well, kind of), so I am qualified to espouse great wisdom on my experiences in software engineering.

Last week we had cause for a couple of refactorings in our EMF models.

The first refactoring was very simple. One of our metamodels had a traceability link to source model objects, which needed to be generalised to be able to point to a more structured "assembly" of source model objects. For some reason, I already had a metamodel for these assemblies, so it was a simple matter of moving those metamodel elements into our main metamodel. The generated code for the assemblies hadn't been modified, so I was able to just cut&paste in the EMF editor, and add a reference to allow either single-element or assembly traceability. Then, using eclipse's call hierarchy view, I tracked down all the references to the single-element traceability, and generalised them to handle the new structure.

The second refactoring was more complicated. For one reason or another, we needed/wanted to change the name of one of our metamodel packages (and some other stuff, but let it just be the name). This meant that almost all of our code would change package, and a number of classes would change classname. Unlike the previous refactoring, this would have a huge effect on our generated code, which would need to be moved to new files, in a way that correctly overrode the default generated code. When you generate "over the top" of files, EMF is good at taking care of this, but I wasn't sure it would work when the generated files are "new". (I was pretty sure it wouldn't).

The approach we took was to anticipate all the effects of the metamodel changes we were making. We worked out that these were a number of changes to classnames (where the package prefix forms part of the classname), and a number of package renamings. We carried these out (in that order) using eclipse's Java refactoring (which is very good). Notwithstanding some complaints from SVN, this went smoothly. Then, when it came time to regenerate code from the changed metamodel, EMF found itself "overwriting" existing code, rather than creating new code. The refactoring was completed with only one or two lines of code needing to be hand-modified (for the curious, we had neglected to refactor some inner classes).

A refactoring framework for eclipse would be really nice. I do recall some mention of it on the EMF forum, but I don't know how far they got, or how they were going about it. If I were to go about it, experience like that above would probably lead me to look at essentially mapping eclipse refactorings onto generated Java refactorings (probably implemented as commands, off the top of my head).

In the interim, my advice would be that whenever you are refactoring a metamodel, think about the consequent changes for your non-generated code, and if necessary consider pre-empting the metamodel refactoring with Java refactoring. This way of thinking might not be elegant (the "no-one thinks about bytecode/binary when they're writing Java/C" argument), but it can save you some pain.

(From a more academic, "transformation" point of view, this is probably a good argument for traceability in transformations, and for treating "replay" transformations differently to "green field" transformations).

Tuesday, September 30, 2008

microsoft oslo

I'm really impressed to see Microsoft's continuing push towards modelling as important. Their hiring of good people over the years - Jack, Wojtek, Stuart, Steve, etc - and recently of recognising the benefit of playing nicely with others on modelling (which I assume is the reason for Steve Cook being back at an OMG meeting after a long absence).

However, this kind of presentation really makes me cringe. The implication that Microsoft are the real drivers of modelling is kind of rough on the people and companies that have been working on the associated tooling (storing, creating, serialising models, among the things mentioned in the video - no mention of transforming, yet) for a decade or more. I do kind of realise that its not meant for me, and hopefully at some point I'll have the time to check out, or someone will point me towards, what MS are doing. Coming in late does offer them some advantages in terms of cherry-picking the ideas that work from those that maybe don't.

Friday, September 26, 2008

posting hiatus

Its been a while since I've posted here, and its not the first time I've said that. I've been engineering away, trying to get the estimator feature-complete. I've had a couple of periods of high productivity, particularly when I implemented the rule language and rule engine, and when I was doing some of the traceability (selection sharing, etc) features. In the interim, there have been some slow sections, and some time spent doing non-development things like investigating how the software scales with really large models (not well), and doing some commercialisation- and publicity-motivated demonstrations.

Tuesday, July 22, 2008

meta-pizza

Its creator dubbed it "Fractal Pizza", but for this blog, it can only be Meta-Pizza!

Friday, May 09, 2008

What am i reviewing?

One of the jobs that becomes more prominent upon the completion of PhD is the reviewing of papers. I probably reviewed a half dozen papers a year during my PhD, usually on behalf of one of the full academics in our team. This year, it will probably wind up more like 20 or so, for a mix of conferences, workshops, and journals.

What I'm finding is that about 2 out of 3 papers that I review is riddled with basic grammatical errors. I'm more than happy to overlook a certain density of errors, but perhaps half of these present with errors in a density that would see a university paper sent back to the student with a fail, with little regard for the technical merit of the ideas being presented.

So, do we hold academics to a lower standard than students, on the grounds that a higher proportion are non-native speakers, and that the merits of the ideas outweigh the faults of the presentation?

Personally, I am finding that my critique of the technical merits of these papers is suffering because I am spending too much time correcting, or simply being frustrated by, faults of presentation. The paper is more difficult to read, so the review takes longer to complete, and the lost continuity makes the technical contribution harder to understand. I also spend less time thinking about the science and the relevant technical questions, because I'm instead scribbling down "needs a definite/indefinite article" and "plural: are not is".

I am not unsympathetic to the difficulty of writing in a non-native tongue; the summary chapter of my thesis was riddled with grammatical errors (ed: I confess I did send this chapter to a French journal; I regret doing so, and it was quite rightly rejected because of the poor quality of its writing). However, I also spent a long time correcting the grammar of my colleagues at the lab in France so that their papers might be more legible when they reached reviewers. This is when the majority of such correction should be done. By the time a paper reaches a reviewer, there shouldn't be more than a couple of errors per page, at the most.

Well, there's my rant for the day. It will make me feel 3% less guilty about my review taking so long to get done.

Wednesday, April 16, 2008

timely change

I only started using Outlook (or Outrage, as Robin calls it) about 9 months ago, which was about 6 months after I started using Google Calendar. the lack of integration between the two was very frustrating.

I had initially heard a rumour that a bridge was possibly if one had Outlook 2007, but as I didn't, it didn't help me. Of course, I should have realised that it was a better idea to hope for a solution from Google than from Microsoft. Sure enough, Google Calendar Sync!

It's missing a few features - it only syncs to the first google calendar (which isn't my "work" calendar), and I'd like to be able to control the privacy settings of the incoming events - but it essentially works.

STEP/Express

Over the last couple of weeks I've been getting to know STEP/Express. STEP is the language used to define IFC, which is the standard modelling language interchange format in the world I'm working at the moment.

STEP bears a resemblance to MOF, both in its purpose as a language for defining modeling languages, and structurally, in terms of defining object types, attributes, references (right down to opposites), etc.

The first two days of the course were to do with Jotne's model server, which is essentially like a MOF repository but with domain-specific extensions for model visualization (plugging into a 3-D IFC viewer). There was a fair bit of support for model versioning (versioned at the model level rather than the object level, and with customisable and/or partial checkin/checkout), permissions (although I wasn't very satisfied with their permission model), and even domain-specific merging.

The last few days were to do with associated technologies. There is a language, Express-X, for writing what they call "query functions", which are really just server-side procedures. In many ways, Express-X fits the sort of role Kermeta tries to fill for MDE, a language for the manipulation of models. The similarity ends there, though. Express-X is procedural, with global variables, and various other language design decisions that I've never seen (real literals without trailing 0s ("1."), "++" as a generic insertion operator applicable equally for integer increment, set insertion and string concatenation) or things I wouldn't personally have done (1-relative arrays). I won't be carving out a career as an Express-X programmer.

They also have a bunch of tools that one can imagine for MOF/MDE. They have an ontology-like language which they use for common model elements, much the same way as I've heard MDE people talk about using ontologies. They have a validation framework for people to build model-checking modules, and they're sniffing around some process-modelling stuff.

This isn't the first architecture I've seen with a lot of things in common with MOF/MDA, and I won't be switching, but its interesting to see people in different fields moving in the same direction.