...and how best to handle success/failure feedback to a view layer.
Assuming that the business objects will be iterated over in the business logic method if the loop is put there (i.e. not a bulk update operation), code options in the view logic are:
doBusinessLogic( Set businessObjects )
or
for (businessObject : businessObjects) {
doBusinessLogic( businessObject )
}
Sense would say that the former is correct, as it gives control of optimisations, etc. to the business logic method. However, this vastly complicates error handling and feedback to the view layer (assuming you are aiming for a consistent error handling/presentation model).
Assuming that we want a view layer that receives success/error feedback in a consistent way (i.e. from single or multiple business object operations), what is the best approach?
Clarification:
Handling multiple exception types thrown from a business logic call back in the view layer is code heavy and also causes maintenance problems (new exceptions are introduced which the view logic doesn't know about). The ideal is for a business logic method to handle errors in its own layer and "package" them for the view to deal with in a consistent way.