0

Let's say that I need an object that describes a person and his possessions.

The returned object from this method will have the following JSON structure:

{  
   "name":"John Doe",
   "age":22,
   "posessions":[  
      {  
         "type":"car",
         "name":"Bugatti Veyron"
      },
      {  
         "type":"house",
         "name":"Stepney Green mansion"
      }
   ]
}

The thing is that I get the person data like name, age etc from a source. Let's name it getPerson() and the person possessions from another source named getPersonPossesions(). All I need is to form the returned object in a wrapper method.

How do I name this method?

P.S. I don't use SQL so merging data together having a big query on the database isn't an option.

I've been thinking about:

  • personWithPossesionsDataGrabber()
  • personWithPossesionsObjectBuilder()

1 Answers1

0

If your question is really only about naming a method, that's simply a matter of opinion for the most part. I personally think getPersonWithPossessions sounds pretty good.

kamoroso94
  • 1,713
  • 1
  • 16
  • 19