JavaFX tries to enable the MVC-Pattern. The Model should be created with Properties to take advantage of Binding. In your case the Model is the Person class, so you can simply add the StringProperty firstName. But in JavaFX you have to take care of the other naming convention as for simple getter and setter in a Pojo Bean.
Naming Convention for Properties in JavaFX are:
public class Person {
private StringProperty firstName;
public void setFirstName(String value) { firstNameProperty().set(value); }
public String getFirstName() { return firstNameProperty().get(); }
public StringProperty firstNameProperty() {
if (firstName == null) firstName = new SimpleStringProperty(this, "firstName");
return firstName;
}
private StringProperty lastName;
public void setLastName(String value) { lastNameProperty().set(value); }
public String getLastName() { return lastNameProperty().get(); }
public StringProperty lastNameProperty() {
if (lastName == null) lastName = new SimpleStringProperty(this, "lastName");
return lastName;
}
}
After that you be able to bind for example a TableColumn of a TableView to the Property "lastName"
TableView<Person> table = new TableView<Person>();
ObservableList<Person> teamMembers = getTeamMembers();
table.setItems(teamMembers);
TableColumn<Person,String> lastNameCol = new TableColumn<Person,String>("Last Name");
lastNameCol.setCellValueFactory(new PropertyValueFactory("lastName"));
Without a Property this would be much more code and you won't have the advantages of implemented ChangeListener/InvalidationListener support.
The example above comes from JavaFX TableView
So the recommended way in making a Model for JavaFX is using JavaFX-Properties and not the build in types.