Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Good idea to reuse the object?

 
susmitha singh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would certainly create a class to hold only the variables you need.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic