Question

I'd like to have a GWT app with a UI that is configuration-driven, meaning that if I make certain database changes, or deploy a different XML descriptor (outside the WAR), then I can change the look, feel and behavior of the UI without deploying any code changes. My reasons for wanting this lay outside the context of this question and I would need to provide way-too-big of an irrelevant backstory to justify placing it all in this question.

For instance, say with one particular configuration, the UI (a place in GWT verbiage, or page/screen) might just consist of a simple button in the center of the screen. Then, I make some database changes, and now, the same place renders with 4 buttons in each corner of the screen, and a "Hello, GWT" label in the center. Same code, but different DB values (or XML) cause the UI to look/feel/behave differently.

I'm trying to figure out how to design such a system, but am struggling and not sure if it's even possible. If it is possible, I'd appreciate a good explanation on how it might work, and maybe even some pseudo-code to get the creative juices flowing.

If it's not possible, then I'd like a concrete (definitive) answer as to why. As I've found on StackOverflow so many times now, when someone says "this is impossible!" it's usually just an advanced topic that is beyond their level of understanding :-), and what I'm asking isn't impossible, it's just hard! Thanks in advance!

Was it helpful?

Solution

Yes, this is definetely possible. I've went once through that.

But it's not a standard way of doing, so don't expect to find much in internet. You must invent the solution yourself.

Simply, you must create a channel/service/JSON service from which the GWT application will read your configuration, and build the UI according to it. You can invent your own description language, or use some existing format, for example XUL, to describe the UI. It's however a hard way, but giving a lot of satisfaction once you accomplish it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top