<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Joseph Alotta<br><b>Sent:</b> Thursday, May 26, 2016 4:32 PM<br><br><o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><br>&gt; Extra credit: Why would you use a class variable? &nbsp;We know that an instance variable is used to store data within the context of an instance. &nbsp;Why would you want to store data in the context of a class? <br><br>Window closeAllWindows needs to have a list of all the windows, and sends each one the close message. &nbsp; Or if a instance of a class needed to communicate with other members of its class. &nbsp;For example, a class of helicopter bots that fly together as a group. &nbsp;They would need talk to each other to avoid collisions. <br><br><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><b><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>[Ron Teitelbaum] Exactly!&nbsp; Well done.&nbsp; Any dynamic information that is related to all or a collection of instances should be held on a class variable.&nbsp; You could of course create a framework by adding another object whose job it is to manage all these instances.&nbsp; Then your class variable becomes an instance variable on your manager class.&nbsp; It could also be used for a class with just one instance.&nbsp; Create it and store it so that it&#8217;s reused when asked for a second time.&nbsp; You will see that a lot, <o:p></o:p></span></i></b></p><p class=MsoNormal style='margin-bottom:12.0pt'><b><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>^Instance ifNil: [Instance := self new. Instance].<o:p></o:p></span></i></b></p><p class=MsoNormal style='margin-bottom:12.0pt'><b><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Nice job!<o:p></o:p></span></i></b></p><p class=MsoNormal style='margin-bottom:12.0pt'><b><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ron<o:p></o:p></span></i></b></p><p class=MsoNormal style='margin-bottom:12.0pt'><br><br>Sincerely, <br><br>Joe. <br><br><br><br><br><o:p></o:p></p><div class=MsoNormal><hr size=3 width=300 style='width:2.5in' align=left></div><p class=MsoNormal>View this message in context: <a href="http://forum.world.st/FileDirectory-tp4897377p4897633.html">Re: FileDirectory</a><br>Sent from the <a href="http://forum.world.st/Squeak-Beginners-f107673.html">Squeak - Beginners mailing list archive</a> at Nabble.com.<o:p></o:p></p></div></div></body></html>