Initialization of String

If you have defined an attribute of type you might be surprised to see, how UMLDesigner is initializing the string variable:


aString := OrderedCollection new

Strange, isn’t it? Well the reason comes from UcmAttributeModel>>generateSmalltalkInitializationOn: writer

Here one can read, that all attributes with a collection type should be initialized in that way … and is actually defined in that way …

Another way to change this behaviour is to change the definition of UmlString within the Kernel Model and deletes the “Refinements” of protocol and throw away “Collection” (its a pretty hard way to find out the correct way to do it …)

This entry was posted in Smalltalk and tagged , . Bookmark the permalink.