View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 3 - Kaori Takeuchi

Part I: Describe a problem you experienced in Squeak.

I have encountered several problems when I started using Squeak. I am going to list some of them.

1. Determine a super class

Since I was totally new to Squeak, I had no idea the characteristics that each Morphic class, such as TextMorph, SketchMorph, BookMorph, or PasteUpMorph has. Even though the class names provide me some clues of how they should be implemented (for example, BookMorph must be a class that deals with slides or "book"), I had to spend enormous time to investigate what kinds of methods BookMorph has and its inherited behaviors. Also, it was hard to find the difference between PasteUpMorph and Morph class. So when I created my own class, like AddImageMorph, I couldn't make up my mind on which class I should inherit from because what I needed was a simple rectangle morph which can paste a piece of picture. Could it be SketchMorph, PasteUpMorph, or simply Morph? The reason I had this kind of problem might be that I didn't take enough time browsing the classes to understand the entire structure of each class. Finally, I solved the problem by choosing PasteUpMorph as a base and added an instance of SketchMorph class on the PasteUpMorph so that I will be able to include several buttons (e.g rotate picture, new picture) on the PasteUpMorph while the image stays on the same spot as SketchMorph.

2. Type of Parameters

While I was browsing BookMorph class, I noticed that paratemeters of some methods are somehow vague. For example, a method

"goToPage: PageNumber"

takes "PageNumber", which seems to be some kind of numbers or integers. This is not the problem. However, when I encounter

"goToPage: PageNumber transitionSpec: transitionSpec"

I didn't know what type of object "transitionSpec" is looking for. In Java API, it always mentions the datatype of each parameter we should pass so it was easy to create one and pass it. But Squeak doesn't appear to be that way. The only way I overcame this problem was to look for examples on Squeak Swiki and tried to figure out what it is passed.

Part II: Read other posts.

1. Matthew Plowden
His solution was helpful especially because I didn't work on Link-to-Page part at all, but my teammate had that problem and we couldn't find the solution until the end.

2. Russell Myers' Discussion 3
He describes how AlignmentMorph works and it was very helpful because it includes actual code examples and brief comments. I have spent some times investigating this class but it appears to be complicated so I finally didn't use it. But from now on, I would be able to take advantage of this class to create a neat layout for my future projects.

Links to this Page