This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Developing JAX-WS Webservices using Top down approach. the wsdl is defined with xsds, generating java code using IBM RAD tool creates package structure and all Request and Response java classes in Web Service Project. Most of these java objects represent the actual domain objects which will be used by DAO layer.
If we package DAO layer and business services in a separate project/jar, the Domain objects have to reside in this project.
Can anyone suggest the best option of handling this. Should we have all DAO layer within Web Service project so that DAO uses the classes generated using WSDL or move these classes to DAO project which requires a manual step whenever wsdl is changed?
The classical answer is: It depends.
It depends on whether you expect changes to the web service or not, whether you expect changes to the system or not.
If you want to decouple the web service from the domain classes, then you should not let generated code leak down to the DAO layer. In fact, I would suggest having a look at the hexagonal architecture - develop the application without UI, database etc etc and, when the application itself is ready, add different kinds of adapters, in your case a database adapter and a web service adapter, as needed.
If you are in a hurry, do not expect changes in the web service or in the application etc etc, then you can generate code and use it in the DAO layer too.