Skip to main content

Posts

Showing posts from February, 2017

Project in Review - Part 3: What didn't work

Of course, not everything was an unmitigated success. I tried many things that didn't work out. Much of which I've removed and forgotten about, but a few things remain - either scarred into my psyche or woven too deeply to fix. What didn't work Storing my entire configuration in application.properties Using properties files is great. It let me get configuration out of a profile document and into something much easier to edit - particularly configuration that users will never see or maintain (and thus there is no need for an interface for). But I took it too far. The paths to the other databases are there, and that's good. But view aliases are also there, and that was a mistake. I already have a ViewDefinition enum that describes each view and all the information I need to know about it. I could have set view names there, but instead I'm reading them from the application config. I can change where a view is pointing without having to go into my code. Except of co

Project in Review - Part 2: What worked

Here are some of the techniques I adopted that turned out great. I made no claim to innovation or superiority. What worked? PhaseListener: Having a PhaseListener to let me know where I was in the JSF lifecycle was extremely helpful. I used this information constantly to determine the state of various objects at any given time. In fact, as much as I know it's bad technique to troubleshoot via print statements, I found it invaluable to be able to observe the exact order of state changes. That being said, it's important to note that THE CONSOLE LIES! If you see something very unusual happening, like the lifecycle restarting multiple times or events just never finishing - look at the console log. My experience was that what appeared to be going on in the log was not necessarily what was going on, but if it looked crazy it was an indication that something wasn't right. I don't care if you're trying to go pure Java as I did, or pure SSJS - a PhaseListener is a si