this question has answer here:
what's purpose of baseadapter
s? when should used instead of arrayadapter
s? see baseadapter
used time, why not use arrayadapter
? arrayadapter
extends baseadapter
, therefore inherits methods.
it's d in solid, i.e. dependency inversion principle.
in other words, when designing code 1 should depend on interfaces , base classes, , not concrete classes. in particular, should depend on "the maximum number of features need" in class/interface. if don't need more baseadapter, don't depend on arrayadapter.
if you're planning on creating own adapter, feel free extend arrayadapter if suits needs. baseadapter base interface used several adapters, classes needs adapter can use that.
Comments
Post a Comment