3 ms·
Another rant. :-) I think the pattern is sufficiently broken that it is an anti-pattern. Look at the Sun definition http://java.sun.com/blueprints/patterns/MV
by russell 18y ago
Another rant. :-) I think the pattern is sufficiently broken that it is an anti-pattern. Look at the Sun definition http://java.sun.com/blueprints/patterns/MVC-detailed.html http://java.sun.com/blueprints/patterns/MVC-detailed.html. It tries to encompass J2EE and swing. What happens is the pattern gives no good guidance to a programmer. The pet store example is even worse because it gets tangled up in EJBs. My personal pattern is to write the model as a POJO (Plain Old Java Object, no framework cruft) so I can write simple unit tests and to package the result as a HashMap. The view part is also very simple, variables, loops, and ifs, no calculations, no Struts goodies. Life is so much simpler.