logo

Crowdly

Browser

Add to Chrome

public class RetryDecorator : IService { private readonly IService _inner; ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

public class RetryDecorator : IService

{

private readonly IService _inner;

private readonly int _max;

public RetryDecorator(IService inner, int max = 3) => (_inner, _max) = (inner, max);

public bool Execute()

{

for (int i = 0; i < _max; i++)

if (_inner.Execute()) return true;

return false;

}

}

Чому це Decorator, а не Proxy?

100%
0%
0%
0%
More questions like this

Want instant access to all verified answers on do.ipo.kpi.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome