[squeak-dev] design issue of someone trying to think like a smalltaker

Chris Cunnington smalltalktelevision at gmail.com
Tue Oct 16 18:09:42 UTC 2012


On 12-10-16 1:53 PM, Joseph J Alotta wrote:
> Greetings,
>
> I have several Accounts and the accounts have Transactions.
>
> My plan was to instantiate a Transaction and to populate it from a file, and then have each of the Transactions
> attach themselves to an Account.
>
> This is a sort of bottom up design.
>
> The problem is that I have a bunch of Accounts and Transactions running around the system and no tools for working with them.
>
> I can do Accounts allInstances do: [].   But then I also get old instances (from debugging).
>
> Is this a good way of doing things?  Do I need to have some Collection somewhere, so I can go and find each item
> when I need it?  Like a common control mechanism?  And if so, what would it look like?
>
> Do you think I should create a list of accounts and then each Account will have a list of Transactions?  The old top down approach?
>
> Sincerely,
>
> Joe.
>
>

Keeping things in the image and accessing them with #allInstances is a 
bit raw. It's conventional to use a Collection. And, you pull things in 
from files with Streams. Squeak By Example [1] can help here. Chapter 9 
for the Collections and Chapter 10 for Streams.

Chris


[1] http://squeakbyexample.org/


More information about the Squeak-dev mailing list