Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681465y@sweetnothings how to explain this without the people I work with finding me🤔
Essentially it is a configurable set of rules stored in the database which the business can create, change, and enable / disable at will without notice.
When applicable records are updated the are checked against this dynamic list of rules which the code does not have any working knowledge of the actual rules, but there is predefined criteria of when the rule would apply in different scenarios, and to only evaluate the appropriate rules and proceed or fail (there could be 0 rules or 100 rules applicable to the current state of the record)
So to save on database queries I need to generate a map of all the rules in a searchable manner, while keeping in mind this map could be used against many records at a time in different states. -
vane112845y@C0D4 or recurrence, I build similar rule matching engine for client and those rules also got embedded rules but those were only matched against different values so recurrence was enough :)
-
C0D4681465y@vane
I don't have embedded rules to handle, but this will need to work with related records as well, as some of the known criteria will be outside the record.
I've done many things but I can't say I've built a dynamic rule engine before.
I welcome the insights though. -
vane112845y@C0D4 I don’t remember much besides that update of rule was most nasty thing and I was refactoring this code like 10 times before I was happy with results.
Related Rants
There are days I like to pull my hair out and create a dynamic 4D map that holds a list of records. 🤯
Yes there's a valid reason to build this map, generally I'm against this kind of depth 2 or 3 is usually where I draw the line, but I need something searchable against multiple indexes that doesn't entail querying the database over and over again as it will be used against large dynamic datasets, and the only thing I could come up with was a tree to filter down on as required.
rant
wtf were they thinking
down the rabbit hole
dynamic maps
depth
data driven design