Mantis - Croquet
Viewing Issue Advanced Details
1412 Any trivial always 07-05-05 22:11 07-05-05 22:32
elenzil  
 
normal  
new  
open  
none    
none  
0001412: redundant code in TeapotMorph: initializaeActiveCamera and makeCamera
.. it seems that initializeActiveCamera should probably be calling makeCamera instead of duplicating its functionality.

making discrete methods for the camera creation is great.
i'd love to see something similar for the avatar.
current code:
-------------------------------------------------------------------------
initializeActiveCamera
"makes it easy for subclasses to have different cameras w/out messing w/full init code"

    activeCamera _ TUserCamera new initializeWithViewPort: self.
    activeCamera addOverlays.
    activeCamera viewClip: false.
-------------------------------------------------------------------------
makeCamera
    activeCamera _ TUserCamera new initializeWithViewPort: self.
-------------------------------------------------------------------------

Notes
(0001715)
howardstearns   
07-05-05 22:32   
FWIW, I _think_ I remember creating makeCamera when I needed to customize the TeapotMorph in a new way. I just cut and pasted what I needed, rather than fixing all callers or looking for similar problems (e.g., with avatars). I _do_ remember thinking, "Gosh, there's an awful lot of stuff that requires code duplication in order to customize." I imagined that the idea was to get things working and useable without introducing a lot of hooks and indirection that might need to be rewritten if basic stuff changed. In other words, if things are still pretty fluid, then it's better to keep the code base small and risk forcing folks to duplicate some code on occasion.

My opinion then is that it isn't worth making such enhancements to Jasmine. Only David would know if it's worth putting such hooks into Hedgehog. (E.g., it might be fair to go through one iteration of Hedgehog without the hooks.)