Pages

Oct 12, 2018

[HDGEM] A better approach to avoid using a switch or multi-conditional if-else-if is to use the Strategy pattern.

Converting switch or multi-conditional statements to Strategy pattern


Strategy pattern allows us to have a separate class for each case. We can then add new case more easily.

In addition, having smaller classes means that my unit testing becomes more focused on testing one particular situation.

--
Posted By Blogger to HDGEM at 2/07/2017 07:05:00 AM

QuickBooks Self-Employed

Bigger tax refunds. Better organization. Manage your deductions with QuickBooks Self-Employed .