문제

So I'm pretty new in my current company and my current task is to create a webservice that sends some serialized java objects from service A to service B using jaxws (webservices). The senior on the team encouraged me to copy (ctrl + c) the beans from project A into project B. I think this is not a good idea. As soon as some attribute would be added to a bean of project A, project B wouldn't know of this attribute.

So I could fail or just ignore it - that would be terrible.

So basically my question is what is the normals solution for this? I thought about a project C that is a dependency of project A and project B and holds all the beans that both project send to each other. In project C I could also test the serialization.

도움이 되었습니까?

해결책

Best pracrice is to use different classes on both sides of the service. After all if you were an external client consuming the service you would hardly have access to the service classes.

However, as you point out, that is a pain. I would share the data classes. perhape compile them and stick on an internal nuget repo?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top