Miguel Ángel Ballesteros bio photo

Miguel Ángel Ballesteros

Maker, using software to bring great ideas to life. Manager, empowering and developing people to achieve meaningful goals. Father, devoted to family. Lifelong learner, with a passion for generative AI.

Email LinkedIn Github
RSS Feed

OQL / JEC - Object Query Language / Java Expression Compiler

I created OQL (and it’s successor JEC) to achieve bidirectional data binding in the WAM presentation framework.

Let’s say you have the following expression:

book.pages[selectedPage].text

So, you have a context Map with a key/value pair ("book" -> Book) pointing to a business object Book that holds a list of pages, that’s an object with a text attribute. Another context key/value pair relates the selectedPage to an integer number: ("selectedPage" -> Int).

In the view rendering phase (it was done at the server side, the usual approach at that time), that expression was evaluated (we did a get) and the text of the selected book page was printed.

In the control phase, we received model updates and did a set of that expression.

That’s all :-)

The 2nd version JEC was released to the Open Source community in SourceForge jec.sourceforge.net. Here’s an annotated class diagram of the JEC project:

JEC design