Dynamic Web Development with Seaside

4.2.2Defining Some Methods

Now we define some instance methods to initialize the value of the counter to zero , and to increment or decrement the value of the counter.

While it is not strictly necessary, it can be useful to define categories for methods you add. Middle button click on the all as shown in Figure 35, select "create category" and type in a category name. If you select a method category, new methods will appear in that category.

Create a category

super initialize.
count := 0
count := count + 1
count := count - 1

At this point it would be a good idea to commit your changes to the database. Click the commit button in the transcript window. You should always commit any changes to your code before logging out of GemStone, just as you would save a text document in an editor before logging off of your computer. If you want to throw away any code created or modified since your last commit, click the abort button instead.

Copyright © 12 April 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.