<div dir="ltr">Suppose I want to define a <font face="monospace">Dog</font> class that has the instance variables <font face="monospace">name</font> and <font face="monospace">breed</font> and I want the instances to be immutable. Is this the recommended way to define it?<div><br></div><div><font face="monospace">Object subclass: #Dog<br>    instanceVariableNames: 'breed name'<br>    classVariableNames: ''<br>    poolDictionaries: ''<br>    category: 'MyCategory'</font></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">With this class method:<br></font><br><font face="monospace">name: aName breed: aBreed<br>    ^self new initializeName: aName breed: aBreed<br clear="all"></font><br>And with these instance methods:</div><div><br class="gmail-Apple-interchange-newline"><font face="monospace">initializeName: aName breed: aBreed<br>    name := aName.<br>    breed := aBreed<br><br>breed<br>    ^breed<br><br>name<br>    ^name<br><br></font><div>If I want the following to be the only way to create an instance:</div><div><br></div><div><font face="monospace">Dog name: 'Comet' breed: 'Whippet'</font></div><div><br></div><div>would I do something to prevent using this?</div><div><br></div><div><font face="monospace">Dog new</font></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div></div>