I'm working on a project at the moment that will make use of a certain kind of object (which we will call "Machine" in this case. This type of object has parameters, methods etc. pp. and I want to use its methods. 

In this special case I will have a text field that allows the user to alter a certain property of an object of my own class, lets call it "Name" for simplicity. This property "Name" can be changed by typing a Name into a text field that is available to the user. Validating this text field will call a method from "Machine" for a certain object of that class which can be chosen from a ComboBox somewhere else on that page.  

As these objects are created dynamicly, I have no idea how many of these objects there are and how they are called in particular, I only know that they exist. 

How would you approach this kind of situation? Is there any way that you can basicly say "treat it as XY and use its methods as if you were sure it was of a certain type"? (Like a cast?)
Or would you solve this problem in other ways?