java - Where does the data transformation logic occur in a traditional (non-mediator) MVC architecture? -


i learning mvc style of architecture, using java (swing, in particular).

i understand view graphical interface end-user uses.

i understand model represents information in working memory, database , link between two.

i understand controller supposed handle view in use, , happens when user generates event.

however, confused raw data, taken view, transformed usable data structure program's working memory? controller? or model?

let's have swing program displays different fields arraylist of type person in table. person data type hold different fields relating person's personal information, such name, age, address, etc.

let's have form in our program use submit information. when enter information form, can click "submit" button, takes raw field data , places our data structure, our arraylist of type person in our model.

the thing here though raw field data (several different strings) needs converted object of person type (which holds several different string fields,) in order add arraylist of type person.

my confusion here data transformation logic supposed occur here?

is controller supposed know person data type, , supposed convert data type person(by listener handling "submission" event), , pass object model?

or controller's job merely -ferry- raw data towards model package, , model should have internal mechanism converting raw field data person object?

in sort of situation, responsibilities of each component (the controller , model) start , stop?


Comments