vialab / SMT

Simple Multi-Touch (SMT) Toolkit
http://vialab.science.uoit.ca/smt
GNU General Public License v3.0
43 stars 18 forks source link

SMT.addMethodClasses() should be called for all classes automatically if possible #154

Closed ZachCook closed 10 years ago

ZachCook commented 10 years ago

Without this being called for each class that has zone methods, the zones will not find these methods during initialization

This needs to be better documented at least, if it is not possible to automatically find all the classes.

kiwistrongis commented 10 years ago

I've been thinking about this. My intuition tells me this is a bad idea, and I can't think of a good reason for it's use. There's can only be one PApplet per processing runtime. That means only one intended source for zone methods.

When using SMT with java, this would seem counter to general java practice, and would make designing a nightmare.

The documentation comment holds, though. It should be clear for java programmers how to add their zone methods from some other class to SMT. Overloading the Impl functions is good java practice, but since SMT can't handle anonymous classes, it can't always be done. Perhaps the proper solution to this issue is really resolving #152.

In conclusion, I'm leaning towards closing with the won't fix or invalid tag.

ZachCook commented 10 years ago

I think we just need a better error message when method are not found, as it was kind of common for users to not know why their zones were not finding methods, and how to fix that.

ChristopherMCollins commented 10 years ago

I think we should plan to discuss it in a meeting – I still have some questions about what this is even about.

Is the problem that if I make a secondary class outside Processing, called “TheZone” in a fill “TheZone.java” and I implement touchTheZone and drawTheZone in TheZone.java, it won’t work, because the file TheZone.java isn’t scanned for methods on initialization?

I agree that when working within Java norms, it is strange to implement methods like touchTheZone and have them work through reflection, but I think if we are consistent with the way the PApplet works that would be good.

What would an error message be? If someone creates a Zone in a class outside the PApplet, we warn that the reflection methods won’t be found?

kiwistrongis commented 10 years ago

We've discussed this - SMT.addMethodClasses() is being deprecated as of Issue #174. See it for the details (I'll write the details later, I don't have time atm). As such, this issue is being closed with a Won't Fix.