Hi John,
I was looking at adding a file based storage
mechanism. I want it to
save
each change to a file whenever it happens, instead of waiting some
interval
and then saving all pages. Anyway, I've added my new class, but it
appears
that the #changed: message is getting the wrong argument. The argument
name
is "aStructure", but it is rarely a structure. It appears that most of
the
time it is an Action (e.g., PageEdit, Login, etc.). The only time that
I
noticed a structure was when I added something to the folder using the
Contents page.
I would recommend renaming Storage>>changed: and Storage>>changed.
These
messages are already defined on Object for dependents handling, but
these
methods are doing something different.
I know that this part is not perfect right now. Stéphane already told
me that I misuse the method-names #changed: and #changed, but as that
part of SmallWiki isn't used at all up-to-now, I didn't felt the need
to fix it immediately.
I will correct it as soon as I am back from the Netherlands, but if you
want to fix it directly in the Cincom repository, feel free to do so
and I will be glad to continue working on this version. I won't be able
to touch the sources the next 10 days.
Finally, I'd recommend against modifying
collections outside of their
containing object. For example, the FolderEdit>>moveDown: reaches
inside the
Folder object and manipulates the children collection. The Folder
should be
the only object that manipulates its children collection. Externally
modifying the collection makes it hard to change the representation in
the
future.
I noticed this problem when using code-critics with my code and I will
fix it as soon as possible. Probably I should even remove the direct
accessors to the children of a folder. Especially as a speed-up to
look-up the children might be needed in the near future.
Regards,
Lukas
--
Lukas Renggli
http://renggli.freezope.org