Try to avoid abstract and native methods in abstract classes as much as possible
#29 创建于 2019年11月9日
仓库指标
- 星标
- (8 个星标)
- PR 合并指标
- (平均合并 49天 5小时) (30 天内合并 3 个 PR)
描述
Extracted from discussion on #26 .
This ticket is being made specially thinking in Collections, but might apply to other places.
Currently, collection defines many abstract and some native methods (such as findOrElse(predicate, continuation)).
I believe it would be a better idea to implement as many as these methods as possible, even if it's in a naive way. This would allow some implementations to delegate on this implementations if performance is not an issue and would provide good defaults for new Collection subclasses.
Well known subclasses as Set, Dictionary and List could override these methods with natives as needed, so there would be no performance impact.