On Aug 15, 2008, at 6:00 AM, Scott Gray wrote:

Thanks David, I guess it's pretty subjective and needs to be looked at
on a larger scale rather than just examining small chunks of code.  I
might put that to one side for now unless I come across anything that
looks like it might obviously cause issues.

One example I came across that did concern me was in the
InvoiceWorker.getInvoiceTaxTotalBd() method where if it has trouble
pulling up the InvoiceItems it just logs an error and returns zero
tax.  Any opinions (anyone) on whether it is a cause for concern and
if so what would be the correct approach?  Throw the
GenericEntityException?


I'm not a big fan of the pattern used in the InvoiceWorker and OrderWorker files.

For starters small worker methods like these should throw exceptions instead of trying to catch and hide them, or in other words they are not a good example of when to handle errors internally.

That's aside from the fact that they represent a funny pattern for data preparation logic and might be better as a few bigger methods that do more instead of so many little tiny methods that are as tricky to keep track of as the data model fields and such themselves...

-David



Reply via email to