I’m new to Yii, currently reading the Yii book
I failed to understand the idea of DataProvider and the inheriting ActiveDataProvider
What does it provide that an array doesn’t provide?
Is this some wider known design pattern?
And one more question: how could I answer this question, without asking at the forum?
( I tried the guide and the class reference, and found no explanation (except a formal definition) )
look at and study http://www.yiiframework.com/extension/array-data-provider/
at least it helped me understanding the concept.
I’m definitely not sure, but .NET also has DataProviders, so yes, it seems there’s a pattern. It’s a common concept in OOP to define interfaces that different subclasses have to implement. In this case it’s IDataProvider:
So you can have components that use very different data resources (e.g. array, database, textfile, XML file, yes even punchcards …) but all can be accessed the same way, if they implement this interface.