Smalltalk

This report updates that already in MetaEdit+, adding output for methods. It works on Coad & Yourdon's OOAD Object Diagrams, but should be easy to adapt to other object-oriented modeling languages.

The report specification links below are direct links to the .rep files, which are ASCII files that MetaEdit+ can read with its 'Read from File' function in the Report Browser. Download the report specifications by selecting first the report type and then the appropriate modeling language (report specifications are typically dependent on the modeling language used, and thus for example Delphi generator from OMT is not workable with Fusion). To download use the 'Save' function in your browser.

All report files are supplied 'as is', with no guarantees, and no liability for any damages is accepted by MetaCase Consulting.

Coad/Yourdon OOAD; Object Diagram

Notes

  • Classes (abstract classes) are output first, in alphabetical order, then Class & Objects. This goes some way to making a class be output before its subclasses, but does not guarantee it. Currently the only guarantee is to edit the file by hand (depending on your Smalltalk, it may also be possible to output all Classes and Class & Objects first as subclasses of Object, then continue as in the report below; the redefinitions of each class may move it to the correct place in the hierarchy).
  • Methods are output one at a time, with the protocol 'methodsFor:' line before each one, even if there are several methods in each protocol. This has no effect on the code when it is filed in.
  • Whole-Part structures are followed from classes to produce instance variables, e.g. if BallGame has a Whole-Part structure to Ball, an instanceVariable aBall will be added, and a line explaining this addition added to the comment for BallGame (it would also be possible to look at the Amount/Range property of the role, to determine whether to have 'aBall' or e.g. 'setOfBalls'. Since there is no way of knowing whether this is a Set, OrderedCollection, Array etc., this has not been implemented).

Example

'From MetaEdit+, graph: Ball game - Design'!

GameObject subclass: #CompositeObj
        instanceVariableNames: 'parts '
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
CompositeObj comment: 
''!

!CompositeObj methodsFor: 'As yet unclassified'!

initialize
        "Initializes the whole system."! !

!CompositeObj methodsFor: 'As yet unclassified'!

removePart
        "Removes given part from the part collection."! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

CompositeObj class
        instanceVariableNames: ''!

Object subclass: #GameObject
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
GameObject comment: 
''!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

GameObject class
        instanceVariableNames: ''!

GameObject subclass: #MovingObj
        instanceVariableNames: 'position direction '
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
MovingObj comment: 
''!

!MovingObj methodsFor: 'As yet unclassified'!

move
        "Move method changes the location of the MovingObj according to the given position and direction. It also updates the screen according to the movement operation."! !

!MovingObj methodsFor: 'As yet unclassified'!

initialize
        "Initializes the whole system."! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

MovingObj class
        instanceVariableNames: ''!

MovingObj subclass: #Ball
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
Ball comment: 
''!

!Ball methodsFor: 'As yet unclassified'!

removeBall! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

Ball class
        instanceVariableNames: ''!

Object subclass: #BallGame
        instanceVariableNames: 'aBall aWall aPaddle aSides '
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
BallGame comment: 
'
Whole-Part Structure with Ball has been added as instance variable aBall
Whole-Part Structure with Wall has been added as instance variable aWall
Whole-Part Structure with Paddle has been added as instance variable aPaddle
Whole-Part Structure with Sides has been added as instance variable aSides'!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

BallGame class
        instanceVariableNames: ''!

Object subclass: #Brick
        instanceVariableNames: 'direction '
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
Brick comment: 
'A single element in the wall. It disappears when the ball hits it.'!

!Brick methodsFor: 'As yet unclassified'!

removeBrick
        "This method removes the brick from the wall."! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

Brick class
        instanceVariableNames: ''!

MovingObj subclass: #Paddle
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
Paddle comment: 
''!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

Paddle class
        instanceVariableNames: ''!

CompositeObj subclass: #Sides
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
Sides comment: 
''!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

Sides class
        instanceVariableNames: ''!

CompositeObj subclass: #Wall
        instanceVariableNames: 'aBrick '
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Ball game - Design'!
Wall comment: 
'
Whole-Part Structure with Brick has been added as instance variable aBrick'!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

Wall class
        instanceVariableNames: ''!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!