[Seaside-dev] Two minor implementation questions
Roger Whitney
whitney at cs.sdsu.edu
Mon Oct 15 20:04:32 UTC 2007
Either I am missing something or I found two places with unneeded
code in Seaside.
The first is in WADispatcher. I have
WADispatcher>>beAwareOfChangeOf: anAspectSymbol with: aParameter
from: anEntryPoint
(anEntryPoint == self
and: [anAspectSymbol == #name]) ifTrue: [^ self].
"Here when anything has changed but the name in the
receiver"
version := self version + 1.
lastUpdate := TimeStamp now.
self changed
At issue is the last line of code "self changed". The "changed"
method appears to call Object>>changed, which eventually calls:
Object>>changed: anAspectSymbol with: aParameter
self myDependents update: anAspectSymbol with: aParameter from: self
However as far as I can see WADispacher objects return nil on "self
myDependents". (I think it is a good idea to avoid using dependents
on Object.) So the "self changed" appears to unneeded.
The second place is in WASystemConfiguration. This class is a
singleton. There is a single instance of the class stored in a class
instance variable. This does not seem to make sense. First of all
WASystemConfiguration and its parent class WAConfiguration have no
state. Secondly WASystemConfiguration is an abstract class. So there
does not seem any need for the singleton.
In both classes the main problem with the unneeded code is that it
makes things a bit harder to understand.
----
Roger Whitney Department of Computer Science
whitney at cs.sdsu.edu San Diego State University
http://www.eli.sdsu.edu/ San Diego, CA 92182-7720
(619) 583-1978 (Cell)
(217) 390-6012
More information about the seaside-dev
mailing list