Introduce interfaces for Phidget classes in Java/C# libs
Posted: Fri Jun 08, 2012 12:08 am
Hello Phidget-Community,
one month ago I started writing an application in Java which uses Phidgets to control the lights and speakers in each room of my house. I'm working with spring and I'm used to test everything quite well. And my main problem is that I can't mock a Phidget without heavy usage of a mock framework.
My idea is that the Phidget Team could introduce interfaces for the main Phidget classes and the Manager, such that each developer has the possibility to mock against the interface and implement his own Phidget mock. This would be a non invasive refactoring and the developers could easily dependency inject the Phidget classes.
The classes in the event package doesn't need to be refactored.
What do you think about this?
I attached two sample interfaces which should point out the idea. I'm willing to help the Team implementing the interfaces if they would consider to introduce the interfaces.
I also found some posts about this feature request:
http://www.phidgets.com/phorum/viewtopi ... =22&t=4057
http://jamessdixon.wordpress.com/2010/0 ... last-week/
http://robseder.wordpress.com/2010/11/1 ... t-started/
Please vote for this feature request such that we can test the Phidgets framework easily.
Thanks and regards,
Guy
one month ago I started writing an application in Java which uses Phidgets to control the lights and speakers in each room of my house. I'm working with spring and I'm used to test everything quite well. And my main problem is that I can't mock a Phidget without heavy usage of a mock framework.
My idea is that the Phidget Team could introduce interfaces for the main Phidget classes and the Manager, such that each developer has the possibility to mock against the interface and implement his own Phidget mock. This would be a non invasive refactoring and the developers could easily dependency inject the Phidget classes.
The classes in the event package doesn't need to be refactored.
What do you think about this?
I attached two sample interfaces which should point out the idea. I'm willing to help the Team implementing the interfaces if they would consider to introduce the interfaces.
I also found some posts about this feature request:
http://www.phidgets.com/phorum/viewtopi ... =22&t=4057
http://jamessdixon.wordpress.com/2010/0 ... last-week/
http://robseder.wordpress.com/2010/11/1 ... t-started/
Please vote for this feature request such that we can test the Phidgets framework easily.
Thanks and regards,
Guy