Structures or Objects to group Items?

Posting both would be awesome! There are not many examples for people to use to compare the two approaches (JSR223 and Rules DSL) side be side. It was always a goal of mine to convert my Rules to JSR223 just to be able to have these side by sides and to add a JSR223 section to the DPs, but I’ve not gone past “hello world” in proving that I can get JSR223 to work. I’ve not had the time or patience yet to look into the code to answer questions I can’t find answers to in the docs.

Do you hard code the HashMap, populate it dynamically, or something else? If hard coded, did you consider looking for a way to load it from file so you can provide a little bit of separation between the Rules and the configuration, which is what it sounds like this HashMap contains?

I’ve been thinking of ways to do this (DP idea) but haven’t encountered a compelling use case yet. Some approaches I’ve been thinking about (all Rules DSL):

  • Use the Java Properties Object to load the parameters from file
  • Use a .map file and transform Action similar to Design Pattern: Human Readable Names in Messages
  • Use a file reader or executeCommandLine(“cat properties.txt”, 2000) and parse out the values

Since you’ve actually coded the HashMap up do you have any thoughts?