Bertrand Meyer: OO is about writing DSLs

Michael Stal posted a while ago his transcript from OOPLSA’07. He describes the conversation between some big names in language and OO design in a panel titled “Celebrating 40 years of language evolution: Simula67 to the Present and beyond”. He has an interesting point that were stated by Bertrand Meyer:

Bertrand: modeling is not modeling the world. Relationship between both is very indirect. Whole idea of OO is to implement DSLs (specialized tools, libraries, syntax not required).

Although it is a raw transcript from Michael -maybe Meyer explained this a lot more, maybe the idea was misunderstood- I can’t agree with that sentence.

Using Object Orientation is solving problems using objects. If the object model reflects the real-world model is a matter of (good?)design. Rich (good?) object models will provide a very close representation to the domain of the problem being solved -Domain-Driven Design is exactly about that. But the language used to model those concepts are still about objects and classes, not about business. The language knows nothing about the domain being solved and therefore can be used in all domains.

Using Domain-Specific Languages is using a programming language -a way of expressing yourself to the machine- that is specialized on that business subject. What the developer uses to solve a problem are the constructs provided by that language. The user of a DSL is generally not interested if the underlying infrastrucutre uses objects or functions or whatever to solve his problems, he or she is in a higher level of abstraction.

If you look at the classical DSL examples like SQL and try to implement those as objects you’ll get the idea.

Domain-Specific Languages are about syntax so it’s pointless to say that you will write one if you won’t use an specialized syntax and will still rely on a General Purpose Language that deals with software development and not business concepts.

5 Responses to “Bertrand Meyer: OO is about writing DSLs”


  1. 1 Breckin Meyer Nov 29th, 2007 at 11:05 pm

    Hey!…I Googled for michael meyer, but found your page about and Meyer: OO is about writing DSLs at Fragmental.tw…and have to say thanks. nice read.

  2. 2 Juan Bernabó Nov 30th, 2007 at 12:14 pm

    Hi,

    I think working with OO is about creating models of our knowledge about something with a particular purpose, not about creating realistic models of real world objects on a computer language.

    For me is almost a linguistic experience, I forget about computers and model aloud and testing the model trying to express phrases that make sense, and capture valuable knowledge of the business from it.

    So it´s like modeling concepts and not software, yes shure that the model must be viable to be implemented, presented, persisted, in some computer language, etc. but those are technical constraints.

    It´s like digitalizing (formalizing) some domain knowledge structure.

    So OO models capture the vocabulary and some of the constraints on the structure of that knowledge. But DSLs grammars are constraints on the structure of the phrases that I can express with those words.

    So for me creating a domain model is almost as teach to a computer this new words and with DSL what kind of phrases are legal, or how to express meaning with those words, and at the end having a way to work at a higher level with knowledge.

    But anyway this is just my opinion.

    Juan.

  3. 3 Phillip Calçado "Shoes" Nov 30th, 2007 at 7:46 pm

    Juan,

    OO by itself does not tell you how you should model your domain, that’sright and it was what I said. The Domain Model pattern, in the other hand, says a bit of it. Domain-Driven Design says a lot about it.

    THe point is that you model concepts but you still use the same language. There is no Language Adaptation so no new language is created.

    The language you develop a OO software is a General Purporse Object-Oriented language, not a DSL. That’s my point.

  4. 4 Juan Bernabó Dec 3rd, 2007 at 8:34 am

    You are rigth the OO language where the domain models are implemented is not a DSL, I agree with you totally, I only worked with external DSLs so I have no experience with internal DSL, and what sintax problems may arise with them.

    I was relating my experience working with OO and in particular implementing external DSLs.

    I did some of them, the old days, 13 years ago or so of unix mini languages, with lex & yacc, and after with bison & flex, but inside the implementation was normally a domain model, I mean a model of the language as an AST and a grammar for the external DSL.

    I probably wasn´t clear about it, but any way.

    Juan.

  5. 5 Pedro Dec 4th, 2007 at 2:25 am

    wow, last time I read about Meyer he was in this “Programming Language Inventor or Serial Killer?” game :)

    http://www.malevole.com/mv/misc/killerquiz/

Leave a Reply








Creative Commons License

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.