In REST Web Service, is having 3 layers - Controller, BO (Service) and DAO a standard way? Why do we need a separate BO layer. Why not to write our logic in Controller class which, calls different DAO classes ??? So, basically I want to have all JAX-RS annotations like -
@GET
@Path("/{parameter}")
@Produces("application/json")
in Controller interface and only root @Path
in Controller implementation. I don't want to unnecessarily have another layer of BO. I want to reuse code by calling the Controller classes itself from other Controller classes. I know the classes are annotated but that's for JAX-RS runtime to handle it appropriately. Can I still instantiate those Controller classes and call different methods from other Controllers???
I see two main reasons :