Here is an implemetation of a method in C# but it could be every object oriented language. I needed a method that tries to update a table several times (retryCount=3 for example) and this was my first idea, but I have not seen it here on stackoverflow as an answear for a similar question. Is there a proplem with my approach or just another “good” possible solution?
void UpdateSomeSQLRows(uint retryCount = 3)
{
try
{
//Some Code
}
catch (Exception e)
{
retryCount--;
if (retryCount != 0)
UpdateSomeSQLRows(retryCount--);
}
}
Why is my solution bad or good in terms of object oriented programming.