If I would like to incorporate the JodaTime library into my MVC project. What would be the best way to write the setter/getter methods for my bean? I've currently tied my local variables to the LocalDate object in JodaTime, but this is probably not a good idea (if others use this bean, they may not be able to use the Joda library). Should I make my local variables java.util.Date
objects? If so, would I then convert these java.util.Date
objects to JodaTime's LocalDate in the Controller or the Service Layer (my assumption would be the service layer as that's where my business logic currently resides)?
public class Survey {
LocalDate startdate;
LocalDate enddate;
public void setStartDate(LocalDate startDate) {
this.startDate = startDate;
}
public LocalDate getStartDate() {
return this.startDate;
}
}