It's not a secret anymore!*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 12759
    
    5
I would certainly create a class to hold only the variables you need.

Bill
 
Don't get me started about those stupid light bulbs.
 
subject: Good idea to reuse the object?
 
Similar Threads
Query on location of global access
Answers to IBM 486 sample test
what is the difference?????
Expired Spring voucher
DHCP problem