File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Good idea to reuse the object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Good idea to reuse the object?" Watch "Good idea to reuse the object?" New topic
Author

Good idea to reuse the object?

susmitha singh
Greenhorn

Joined: Feb 02, 2011
Posts: 1
Hi ,

I am new to Web service and trying to develop one service. I have a basic question like we have an Object Address and inside it we have 4 attribute out of it only 2 are useful
can I reuse Address object or should i create a new object that holds only the attribute that are needed for the service.

Example

Address
1. firstName
2. lastName
3. PhoneNumber
4. e-mail

We don't need phone number and e-mail so is it a good idea to use this same Address object or create a new one.

Thanks



William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I would certainly create a class to hold only the variables you need.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Good idea to reuse the object?