sshyran / genxdm

Automatically exported from code.google.com/p/genxdm
0 stars 0 forks source link

SequenceType includes an "accept" method that implements the visitor pattern, but probably shouldn't #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
There are two reasons why this looks problematic:

* It bakes into the API a fixed type system that can be visited (because the 
visit interface itself enumerates options) - adding a new type would require 
updating this interface, which requires adding a new interface that extends 
this one, which would require touching all extending interfaces. In other 
words, this makes the API more fragile for future changes.

* The existence of the visitor pattern seems to be the only reason for some of 
the types in the org.genxdm.xs.types package - possibly, some of the types 
there really are implementation specific.

Original issue reported on code.google.com by eric%tib...@gtempaccount.com on 7 Jun 2011 at 3:44

GoogleCodeExporter commented 8 years ago
Is this connected with the visitor pattern in MetaBridge?  See MetaVisitor, and 
especially note that MetaBridgeOnSchemaTypeBridge is currently the only known 
MetaBridge implementation.  I'm wondering, basically, if an analysis of 
SequenceType in isolation might overlook some current uses (whether they 
qualify as use cases is open to question; it's clear enough that Visitor is not 
the only way one might access schema components).

Original comment by aale...@gmail.com on 7 Jun 2011 at 6:28

GoogleCodeExporter commented 8 years ago
I overlooked MetaBridge. The accept method there is suspicious as well, but 
nowhere near as problematic, because the class/interface hierarchy is nowhere 
near as complex.

Original comment by eric%tib...@gtempaccount.com on 7 Jun 2011 at 6:50

GoogleCodeExporter commented 8 years ago
If it's not really being used, let's just leave it as low priority, for now.  
Too much other stuff looks like it needs attention.

Original comment by aale...@gmail.com on 9 Jun 2011 at 7:28

GoogleCodeExporter commented 8 years ago
Leave it for post-1.0 as well. This stuff is in use, even if it looks wonky, so 
we'd need to understand how to replace the functionality.

Original comment by aale...@gmail.com on 26 Jul 2012 at 7:57

GoogleCodeExporter commented 8 years ago
Changed owner

Original comment by eric%tib...@gtempaccount.com on 6 May 2014 at 9:45