DropObject.st
changeset 2590 d7c53ef7fd3f
parent 2589 ddcdc2e7d3f3
child 2614 f916f680f75f
--- a/DropObject.st	Wed Jan 14 21:52:42 2009 +0100
+++ b/DropObject.st	Wed Jan 14 21:55:24 2009 +0100
@@ -112,6 +112,13 @@
 dropObjectClassFor:someThing
     "given something to drag&drop, return an appropriate
      dropObject class for it."
+    
+    "/ no, no visitor pattern here - I though about it and I think it sucks here.
+    "/ reason: its al local and known here, which DropObjects I am willing to support.
+    "/ addint double dispatch (acceptDropSourceVisitor:) adds a dependency to 6 other classes,
+    "/ and worse: if I ever change my mind to allow for another one, I would have to change
+    "/ that class as well (to add its (accept...) implementaion.
+    "/ So, the typeSwitch below is OK.
 
     someThing isColor       ifTrue:[^ DropObject::Color].
     someThing isImageOrForm ifTrue:[^ DropObject::Image].
@@ -515,5 +522,5 @@
 !DropObject class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.17 2009-01-14 20:52:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.18 2009-01-14 20:55:24 cg Exp $'
 ! !