Hi Ben,

if you plan to use your domain object in a public service you should be carefull. Directly using the object means you will be quite constrained in changing it later. It is quite normal for a domain object to change when your users needs change. With a object that is published in a service this is quite different. When you have many clients for the service you can not simply change the object from one day to another as the clients will need time to do the change in their code. So it can be a very good idea to use separate data transfer objects even if they mean more effort. If you simply use the webservice to talk from client to server in one application you can safely use your domain objects as you control both sides.

Best regards

Christian

Ben Berner schrieb:
I have generated my domain classes (with middlegen tool for hibernate) and
there is a operation in my wsdl document that returns a domain object (e.g.
Employee), so I have to define that domain object as a port-type
(<xs:complexType name="employee">...</>)in the wsdl document.  Now when I
run wsdl2java, won't this overwrite my pre-existing domain class
(Employee.java, that has been decorated with annotations for persistence by
hibernate), as wsdl2java will generate this type when going contract first
development?  Or is there a way, I can ask wsdl2java not to generate that
particular domain object and just reuse the existing class?

Regards,
Ben


Reply via email to