Sunday 5 May 2019

c# - Benefit of wrapping List into class TList

The company I work for has been doing some arguably odd things in their source code.



One of these things I can't wrap my head around (no pun intended) is the benefit of wrapping a List in a class TList.



Example




public class ThingModel
{
//model properties
public string Name { get; set; }
}

public class ThingModelList : List
{
//this is just an empty wrapper, no code is in here in our source

}


in the methods that use a list of ThingModel you would do
ThingModelList = new ThingModelList(); rather than List = new List();



I don't see the benefit of doing this, and it's confused me multiple times (especially with longer names). Maybe someone could give me some insight into the benefits?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...