학교 프로젝트를 위해 Java/Glassfish 4 MVC 웹 응용 프로그램을 작성 중이며 contoller 클래스를 구성하는 방법을 잘 모릅니다.Java MVC 웹 응용 프로그램에서 컨트롤러 클래스를 구성하는 방법은 무엇입니까?
이것은 내가 지금까지 시도한 것입니다.
class User{
private string userName;
//the rest of the fields
private Address address; //here is one problem, is this how i should do it or
//or should i put the primary key of the address there.... How should i structure
// the constructor?????
}
제 질문은 필드를 모델 클래스에만 놓아야합니다. 아니면 여기에 두어야합니다. 누군가 여기 그것이 도메인 객체이고 컨트롤러 클래스의 일반적인 구조를 알고 싶다고 제안했습니다.
질문의 범위가 좁혀졌습니다! –