Implementing separation of concerns via MVC
Posted
by
user2368481
on Programmers
See other posts from Programmers
or by user2368481
Published on 2013-11-04T09:33:57Z
Indexed on
2013/11/04
10:16 UTC
Read the original article
Hit count: 400
I'm creating a question to see if my understanding of MVC separation is correct, I haven't been able to find a clear answer anywhere online. So is this the right way to implement it (in Java):
I would have 3 .java files, one each for Model, Controller, View. I would put all the classes related to Model in the Model.java like so:
//Model.java {
public class Model
//class fields
public Model();
public ModelClassA();
public ModelClassB();
public ModelClassC();
}
With the ModelClasses being any class that I consider belonging to the Model. Is it correct to have the classes within the Model Class, as I have read that nested classes should be avoided where possible.
© Programmers or respective owner