I have a design dilemma I want to share with you guys: I have a class with various member variables that represents a person. One of the members is the home location of the person in coordinates. This class is persisted in a MySQL database.
The issue I have is that I want to have a list of people that are within a certain radius from the recorded distance from the specified person.
I successfuly created an SQL query that returns a result set with the person's details, and its distance from the pin point. But now is the problem: what's the best way to save this data in Java? Saving the distance inside the person class's members is not good, because the distance is not relevant to the person object. I thought about creating a two dimenesional array which holds the person in the first column and the data in the other. Another option I thought is to create a container object with two values, the person and the distance.
What do you think is the most efficient and "object oriented way" of doing that?