Introduce interfaces for Phidget classes in Java/C# libs

What do you need Phidgets to do for you?

Would you like interfaces in Java/C# libraries?

No votes
I'm using another programming language.
Total votes: 6

Fresh meat
Posts: 2
Joined: Thu Jun 07, 2012 11:55 pm

Introduce interfaces for Phidget classes in Java/C# libs

Postby guylabs » 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:

Please vote for this feature request such that we can test the Phidgets framework easily.

Thanks and regards,

Sample interfaces.
(958 Bytes) Downloaded 385 times

Fresh meat
Posts: 2
Joined: Wed Aug 17, 2011 6:35 am

Re: Introduce interfaces for Phidget classes in Java/C# libs

Postby jamie.dixon » Mon Jun 11, 2012 4:17 am

Agreed - but with the new Mocking Framework in VS2012, I beleive you can mock against concrete, sealed, and other types of classes that were heretofore unmockable via MOQ or Rhino Mocks.

In any event, using Interfaces is always a great idea. At a minimum you can make the concrete classes partial classes, so devs can add in additional features and interfaces that they can use...

Fresh meat
Posts: 1
Joined: Thu Jan 24, 2013 4:17 am

Re: Introduce interfaces for Phidget classes in Java/C# libs

Postby deboraha » Thu Jan 24, 2013 4:19 am

So I really have to do set the template from the ...compiler list and selecting Microsoft .Net...then select c#

Return to “Phidgets”

Who is online

Users browsing this forum: No registered users and 1 guest