Hi, I am working on a tutorial problem using Spring MVC, with another teammate for an internship. I'm not familiar with Spring (that's why I'm learning it)
We first wrote the code without any framework support, plain old hand-written MVC
We are using Spring 2.5, and integrated Hibernate, used the Autowire, Controller, Repository annotations etc.. I'm not interested in the view part yet. So we linked to the database, but the models remained the old models something like :
public class Client {
private String name;
private String bankAccount;
public String getName() {
return name;
}
public String getBankAccount() {
return bankAccount;
}
public Client(String name, String bankAccount) {
this.name = name;
this.bankAccount = bankAccount;
}
}
How is this model properly done as the 'M' part in the Spring 2.5 MVC? I'm thinking something among the lines of autowiring, and constructor injection and remaining immutable.
I just can't wrap my mind how this is properly done in the framework. Any help would be greatly appreciated, thanks.