 <p>Instead of using <code>myVar.IntProperty</code> can't you just put them in variables first, like you already did, and then use then for your method?</p> <p>so <code>method(intVar , strVar);</code> seems fine. At least more elegant than casting.</p> <p>Of course, if you're already certain your object will have <code>IntProperty</code> and <code>StringProperty</code>, why not just make an actual object with those properties instead?</p>