Layering Design Pattern in Java clean code style

Posted by zeraDev on Programmers See other posts from Programmers or by zeraDev
Published on 2013-10-30T13:50:20Z Indexed on 2013/10/30 16:11 UTC
Read the original article Hit count: 162

Filed under:
|
|

As a Java developer, I am developing trying to use the clean code rules. But in my team we are facing a concrete problem:

We have a business layer offering a service called "createObject", this service makes a lot of operation which can result to problem. E.g: parentObjectDontExist, objectAlreadyExist, dontHaveAuthorizationToCreate, operationFailed...

and we want the UI using this service to display different information messages depending which error occurred.

In old java dev, we should have create all signed exception type and throw it in createObject.

As Clean code says, it is forbidden to use Exception for business logic AND signed exceptions are evil... Why not...But i don't know how to solved this problem and i don't want to use return code.

How do you do? Thanks for youre experience return.

© Programmers or respective owner

Related posts about java

Related posts about design-patterns