Monday, 9 March 2009

Week 11 of 2009

I've been working on the Action Language for OOA09. I was planning to publish a technical note on Action Language design. However, that discussion will now be included on the main Action Language page when it is published (hopefully this week). I will also be putting the Action Language under change control and it will be a major feature of the next OOA Tool build. A number of interesting issues have surfaced during this work:

  • Are collections needed in an Action Language?
  • Should the creation (and deletion) of supertype object instances (and the associated subtype-supertype relationships) be completely automated?
The first issue will be covered in a separate technical note while the second issue is discussed below.

Most of the existing Shlaer-Mellor and Executable UML Action Languages (e.g. [OAL02] and [ASL03]) take the view that all object instances are created and deleted separately from each other and that subtype-supertype relationships are related and unrelated separately also. However, [xtUML02] proposed that supertype object instances and subtype-supertype relationships (called generalizations in Executable UML) should be created automatically whenever leaf object instances are created. Furthermore, when a leaf object instance is deleted, all supertype object instances and the associated subtype-supertype relationships should be automatically deleted. Where a leaf object instance is part of a multiple subtype-supertype hierarchy then a leaf object from each hierarchy must be specified in the Create object instance statement. This proposal significantly reduces the amount of creation and deletion code required in an application, especially if the application uses lots of subtype-supertype relationships.

Shlaer-Mellor and Executable UML also support the concept of subtype migration while most object-oriented programming languages do not. If users are no longer able to relate and unrelate subtype-supertype relationships then we need some way of performing subtype migration. xtUML02 proposed a new Action Language statement that could reclassify object instances:

RECLASSIFY OBJECT INSTANCE variable FROM objectName TO objectName
However, this proposal requires multiple statements to perform reclassification across multiple hierarchies which is potentially inefficient since each statement may require a complete rebuild of the object instance hierarchy if the deployment programming language is object-oriented. An alternative more generic and potentially more efficient statement is given below:
RECLASSIFY OBJECT INSTANCE variable AS objectName { ',' objectName }*
There is no need to specify a from clause here. There is also no need to specify a leaf object for each hierarchy unless you want it to be a specify subtype in each hierarchy after the statement is executed.

OOA09 will adopt this approach for object creation and deletion and will support the above reclassify statement. However, for backwards compatibility with OAL, a Manual Supertype Creation : Boolean = FALSE attribute will be added to projects to allow users to create object instances without automatically creating supertype object instances and the associated subtype-supertype relationships. However, using this option will not be recommended since it is verbose and error prone. It will of course need to be used in projects loaded from BridgePoint export files.

On a completely separate note, the programme for Code Generation 2009 has now been published. I went last year and wrote up some notes (see Code Generation 2008). However, I am somewhat disappointed with this year's programme. There doesn't seem to be anything for hardcore 'model is the code' analysts and developers. Chris Raistrick from Kennedy Carter is giving an unspecified talk on Executable UML. However, it will probably be an overview or basic tutorial like last year. I would have liked to have seen some Action Language (rather than DSL) talks. Some discussion on what the OMG is doing with action semantics and fUML would have been useful. Any progress on the new RFP for a standard UML Action Language would also have been very interesting. However, I will admit to not proposing any talks for this year's conference and there are lots of things I could have talked about. Public speaking isn't one of my core skills unfortunately (nerves tend to get the better of me). Maybe, I will propose some talks for next year. I am not yet decided on whether I will go this year.

No comments: