How I came up using logical relationships describing my problem-domain


I have end of last year (2016) started working part of my time as release manager with the regular duty of building software artifacts out of legacy Java EE Components (web applications, web services, batches).

There are a number of tools which we use to:
  • build and release software, namely Maven, Jenkins and Nexus
  • define clusters and their properties for our applications to be deployed on
  • check or adapt the apps configuration, then deploy the software artifacts
  • monitor the deployed applications
Each of these functions implies working with a different toolset, which implies a lot of user navigation in complex directory structures, file systems or web hierarchies, with either an IDE
such as Intellij, a directory/web browser, or by using tools like Git or BitBucket.

Facing this complexity of information can at times be challenging, given that:
  • our build system and toolset undergo regular changes
  • the effort of navigating the information cannot be easily automated, since the tools are specialized into one problem domain, where navigation is typically only possible in one direction e.g. “top-down”: open a software project with the IDE, navigate to the appropriate resources, locate the specific parts to be reviewed or amended
  • many applications have to be maintained in parallel in a consistent manner
  • there is a natural tendency to forget actual answers to the question: “where is that stuff actually configured” ?
I have then started defining Prolog(*) predicates for most of our abstractions, such as:
  • application
  • application jar file
  • application parameter
  • application deployment street (family of clusters where an application gets deployed)
  • deployment cluster
and within 1000 lines of code been able to come up with a usable workbench to navigate and interact (via queries in the Prolog console) with our system in a repeatable manner.

Most important is the fact that Prolog predicates enable me to navigate the information in whichever ways I want to, since the predicates can be used in one or the other direction with no problem at all: most often in my work is some “bottom-up” navigation required to identify which applications are actually concerned by a software or configuration change.

Another aspect is that all these predicates can be combined on the spot with no effort at all, to perform complex queries such as:

“What clusters will be impacted if I change the version of a jar file due to a software fix ?”

This question implies navigating through these relations

application jar file > application > application deployment street > deployment cluster

Both aspects involve a lot of work if using a separate set of tools.

I will in the spirit of this blog start a set of articles covering aspects of Prolog development which I found most useful and not being properly covered elsewhere.

Happy reading !

(*) with SWI Prolog: http://www.swi-prolog.org

Comments

Popular posts from this blog

A possible solution for using the janus interface on MacOS with docker

Meaningful Xml Diffs with SWI-Prolog

Prolog DCG "distilled" - Part 3 - Capturing and assembling textual elements from rules