Design Patterns 101.
The model is designed to store data (usually with database support).
A view is intended to represent data (without manipulating it).
The controller is designed to manipulate the model and transmit this view (choosing the right locale, for example, will go here).
MVC does not necessarily mean that you have 3 different classes, but 3 components or layers. They are abstract and do not have to be tied to one physical class. Inside your controller level, which may consist of any number of helper classes or any other.
I agree with part of what the cartoon says, everything is intertwined. For example, if you create a view for a shopping cart, but the model contains birthday information, then it will not work. This is just a design template that helps eliminate duplication of effort. When you have less variables and less noise, it’s much easier to focus on what needs to be done and understand it very well.
I had a discussion with our team about using annotations to render forms on a web page. These annotations were placed in a model or entity class. You will often work directly with entity classes, so it eliminates quite a lot of overhead and duplication of effort if you post your annotations here. Since your annotations are placed directly on the model class, you cannot get a glimpse of the birthday, it is simply not possible. In addition, following the patterns, you remove garbage that does not add value to the final result. You just write business logic and don't come close to anything else.
Although annotations were in the same class as the model level, the presentation or presentation level consisted of annotations and auxiliary classes. It does not have to be different classes or borders.
Another example. In the past, I have worked on some “applications” on the Internet. I use applications because they were a monolithic block of code, more or less the only main method with all the logic there (which is hardly a functional application).
If you do not abstract code in functions and just use one method, you will get a lot of duplication of effort. If you tried to understand this monolithic code block, you would run into a bunch of troubles (like me, it was hard to find out what was going on, then I would find a similar code block somewhere else and be stunned why few things were changed the way they were).
You can do it the way you want, but design templates such as MVC will help you simplify what you write to make it work, and easily wrap your head around the solution. Another popular design template or approach is shared and won.
To answer your original questions:
In Java, localized data will be executed transparently by the application. For example, if you want English support for English, you must create a properties file:
messages_en-US.properties
and then post all your American English content there. Depending on how much content it can be, you can use a different approach.
For my application, I have whole pages in another language, so I do this. My controller determines the client locale or best match. Then he selects which view displays and passes the model (data) to the view.
If you need dynamic formatting for your date / time, your controller is responsible for determining which one will be used. Then your view is responsible for using this converter to format the value.
I use JBoss Seam, so the MVC design pattern is still used, but more abstract. I do not have the actual “controllers”, but an interceptor that is responsible for processing certain functionality (determining the client’s locale, and then another for their preference for date / time). My controllers, which would be equivalent to the Spring controller, are the action components responsible for handling the actions on the page.
Walter