Skip to content
Advertisement

Should Exceptions be placed in a separate package?

I am taking on a project where all the Exceptions have been placed in a separate package com.myco.myproj.exceptions.

Is this good practice?

Advertisement

Answer

I would expect the exceptions for a package to exist within that package. e.g.

com.oopsconsultancy.models.pricing

would contain pricing models and related exceptions. Anything else seems a bit counter-intuitive.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement