jeudi 3 septembre 2020

C# Changing an Existing class - Best Practice [closed]

I am trying to figure out the best way to change an existing class. So the class is called ExcelReport and it has one method Create(data,headings). This is live and used in many places. Now recently I want to change the method so I can format columns in excel. Create(data,headings,columnformats)

So as not to upset my existing programs the best I can come up with is to add another method Create2(data,headings,columnformats) to the class. Is there some creative way I can do this with interfaces or extension methods ? Regards, Niall

Aucun commentaire:

Enregistrer un commentaire