I am designing a component based system using JSF2 on top of Spring's IoC Container.
It is to employ a service layer between a controller and the domain/business layer (I anticipate the controller is nothing more than the JSF Servlet binding in the web.xml file).
The rationale for the service layer (which conforms to an interface for each service) is to allow for the services to be changeable.
It has occurred to me that the return types of the objects from the service layer objects are likely to be business objects from the business layer, which would then be used in the backing beans for the JSF view to populate the UI components on the pages.
Is it acceptable as a standard practice for these business layers,
say a Customer() object coming back from a FindCustomerService, to
just be passed back to a Presentation Layer backing bean? Can the Presentation Layer know about the Business Objects or are these not a part of the Service/defined for use in the Service Interface and therefore part of the contract for a Service implementation?
Alternatively, should I be thinking about representing components on
the UI using a generic set of UI classes within the backing beans, which are then mapped to the return types coming back from the Service Layer in another layer between the
Controller and the Service Layer? (This would likely require re-engineering if a Service was changed?)
Perhaps it is a standard practice to return using standard language scalars and object return times from the service layer to avoid the need for a translation layer?
First SOA project. Figured this would make a nice question for archive and links to appropriate patterns would be greatly appreciated.