I’m going to try to implement the MVC (model, view, controller) design pattern to this.
The interface (view) would be through Processing or an iphone app. The arduino would take care of the model and controller part.
Say I’m going to add a thermometer and solenoid to the i2c chain. In the view I click add device, and I would add the devices mentioned. I would also use the view to control the logic to the devices as well; like IF thermometer > 78F then turn off solenoid.
So there would be predefined classes like a thermometer class and a relay class etc. Whatever you choose, Arduino would instantiate the correct class and pass in certain parameters… As you can see there would be some logic to this, that’s why I’m thinking objects would be best. There are other logic too like maybe a logging system like: log temperature every hour into logging device.
So from a userbility POV, this is vastly superior to write new code and recompile into the arduino every time you add new devices or if you want the device to behave differently.