Dataset versus PyDataSet confusion

Loving Ignition as we do, there’s one particular thing we’ve found which tends to both confuse new users and trip up more experienced developers: Datasets versus PyDataSets. Having 2 incompatible dataset types is not really helpful. Both dataset types implement a different set of methods which means that they cannot be used interchangeably. We’ve had a look at the problem and think there’s a number of different paths which could be taken to try to reduce this confusion.

If you made Dataset implement the methods on PyDataSet you could then deprecate PyDataSet. From the Python perspective (with the benefit of multiple inheritance) this makes sense. This would then allow use of Python structures like ‘for row in rows’. Unfortunately this is not quite so straightforward in Java, and the dependency on Jython in Dataset may be undesirable.

If on the other hand you extended PyDataSet so that it implemented the Dataset interface, it would be possible to write code that uses the Dataset methods but still works when given a PyDataSet.

Another possible improvement would be to make PyDataSet mutable. We’ve been using a wrapper around Dataset for a while which is mutable and it has drastically simplified our code.

We’re interested to hear what everyone else thinks.

I took a look at PyDataSet and it’s not immediately obvious why we can’t make it implement the Dataset interface… I’ll talk to the other guys and see if they’ve got some insight.

Seems like it would be a pretty easy change.