The Model-View-Presenter-Controller pattern

In this post I'll talk about the MVPC (Model-View-Presenter-Controller) design pattern I use in client applications such as progressive web apps and mobile clients. It can be best understood as an evolution of the MVC (model-view-controller) pattern past the MVP (model-view-presenter) pattern. The basics: MVC and MVP You might want to skip this section if … Continue reading The Model-View-Presenter-Controller pattern

Book of dark arts: storing data in the view

Pentagram, source Wikipedia. Towards the end of the year I'll indulge in the dark arts, join the goblins and leave my white architect hat under the Christmas tree where it belongs. I'm helping a friend (a technically minded, non-programmer) write his first mobile app . We wanted to keep everything simple: use technologies which can … Continue reading Book of dark arts: storing data in the view

Eclipse freezes on Windows 10 creator’s update

Symptoms: Eclipse used to work fine under Windows 10, suddenly hangs short after start. Solution: uninstall Linux subsystem or don't use Git in Eclipse Explanation: the Eclipse egit plugin looks for bash, which normally doesn't exist on Windows. When the Windows subsystem for Linux is installed, bash does exist, but blocks with a message ("click … Continue reading Eclipse freezes on Windows 10 creator’s update

Getting test coverage reports for integration test

I'm a vociferous supporter of integration tests with an embedded servlet container and in this post I'll show how to get test coverage for the classes touched in those integration tests. All test coverage gauging tools I know instrument code under test either at build time or run time through Java agents. Because the code … Continue reading Getting test coverage reports for integration test

Java synchronized method concurrent execution

I read this puzzle years ago (unfortunately I can't find the reference) but didn't appreciate it at the time. Java synchronized methods [1] can supposedly be invoked only by a single thread at a time. The essence of aforementioned puzzle was that, if the synchronized method obtains a lock on the object the method belongs … Continue reading Java synchronized method concurrent execution

Debugging Spring REST bad request 400 codes

This happens way too often: you POST or PUT something to a Spring @RestController and Spring only tells you that there is a bad request, HTTP 400 code; no further explanations, no logs, no exceptions. Spring logs the error cause under the category "org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod" so you can enable logging for that in your log4j.properties: log4j.logger.org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod=DEBUG,stdout … Continue reading Debugging Spring REST bad request 400 codes