首页 > 其他 > 详细

List<T> or IList<T>

时间:2019-10-28 21:20:15      阅读:76      评论:0      收藏:0      [点我收藏+]
 

If you are exposing your class through a library that others will use, you generally want to expose it via interfaces rather than concrete implementations. This will help if you decide to change the implementation of your class later to use a different concrete class. In that case the users of your library won‘t need to update their code since the interface doesn‘t change.

If you are just using it internally, you may not care so much, and using List<T> may be ok.

List<T> or IList<T>

原文:https://www.cnblogs.com/dayang12525/p/11755303.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!