Question

Can anyone guide o explain why model class is needed if you can achieve it with cursor already? What is the advantage and disadvantage of this two types?

Was it helpful?

Solution

It really all depends in your needs, definitely cursor can properly address the holding information issue you might have, and its even better because cursors do not load information until is actually requested, however, there's a flexibility in Model Classes that Cursors will not allow, for example, adding/removing data fields on the fly, with a good model implementation you might be able to change easily during runtime your model properties, cursors would require a "requery" functionality and most important in some cases would be impossible because the column might not even exist, also models are less error prone, I've seen a lot of issues caused because the Cursor was closed accidentally when it was not supposed to, either way I'm not saying one is better than the other, I'm just saying it really all depends on your needs.

Hope it Helps!

Regards!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top