I had to code something in Wicket (or take any MVC framework), which provided that 2 variables A and B provide a logical result C, which indicates whether something is visible (checkbox) or not.
Now this is presentation logic, but let it not be as trivial as: C = A && B; Maybe some kind of automatic testing is good.
Where would you put this logic? Is it possible to host it at the Model / Service level and test it with JUnit? In my understanding, the model and services are reserved for business logic.
Or do you keep it in view, in which case you test it with something like Selenium?
Or create some static method in some Utility packages?
I would build it to do this, and build a test for it as simple as possible, but do not mix it with services. Therefore, I would choose the static utility method.
source
share