This section contains tutorials that (should) guid the user through various use cases of Haver’s module system.
Exporting and Importing a Class¶
In this tutorial we will define two classes in two different modules:
Define the two classes and implicitly both modules.
Export one class in its modules application programming interface and import it in the module.
Use the one class in a method of the other class.
Using the Export/Import Wizard¶
In this tutorial we will define two classes in two different modules and let the wizard export and import one of the classes into the other module.
A Complete Application¶
Topic: A TODO-List¶
I will implement a simple TODO-list, because:
It must be available in every Haver image, showing the same state.
These features are nice to have:
Comments, e.g. progress reporting.
Links to Smalltalk code
Multi process use, e.g. use the list from more than one image
Do the simplest thing that may possibly work.
Use test driven development, when ever feasible.
Let’s Do It¶
Obviously we will start by defining
a TODO-List package
a TODO-List class
a TODO-List module
more or less simultaneously.
The test case just made sure, that we can retrieve the TODO-List singleton.
We will add the following features:
a hierarchy of TODO-Items: - A
SimpleItem, with name, title and description. - A
CommentedItemwith additional commenting items. - A
Itemwith an additional due time.
For the time being, we make no decision about the relationship of an itme to a list, maybe the can be part of more than one list or none at all.
We test the creation of instances all such item classes.
The following quite long video contains my way to implement this classes. I cut out a lengthy search for a way to compute the first line of a string. I am not satisfied with that video, it lacks a lot of explaining text. I will try to find a better way to show demos.