Julho 06
Prof(s). Eduardo Bezerra & Ismael H. F. Santos                                                2
2.Preserve encapsulation
nNever let implementation-specific checked exceptions escalate to the higher layers. For example, do not propagate SQLException from data access code to the business objects layer. Business objects layer do not need to know about SQLException. You have two options:
nConvert SQLException into another checked exception, if the client code is expected to recuperate from the exception.
nConvert SQLException into an unchecked exception, if the client code cannot do anything about it.
n
Best Practices for Designing API (cont.)