I've been trying to evaluate the pros and cons of writing a system that generates data reports in two different approaches, but I am trying to talk about these different approaches as general concepts. I know there must be a lot of material on this topic, but I can't exactly narrow down the terminology I am looking for so that I can actually look up the concept... so I'll describe it here.
In simple terms, it's the difference between two approaches, in this case for a system that generates data reports:
1) You make a unique model "hard-coded" (for lack of a better term) to the given report data, meaning that you have a property with the name of the individual unit of data.
For example, a CartonOfJuice might have a property for Color, Volume, ExpirationDate, Price, Label, RefrigerationNeeded, etc.
Then you have a piece of code that specifically runs calculations on a collection of CartonOfJuice models to come out with an output, this may mean that you have a SUM function that specifically calculates a total based on all the Price values on every CartonOfJuice.
This might also mean a new database table for every single unique model.
If you want to add a new model or calculation, you write a new class model with properties attached, and a new set of functions and calculations to handle the input and output of a report related to those new models.
2) Instead you write an engine where you can be given a list of key value pairs, and a class that runs basic calculations on any number of values based on a configuration, including the ability to have custom user defined scripts that define more complex functions.
Now if you want to add a new model or calculation, you don't need to write any new code as long as you've got the basics covered. The user can define a whole new model by defining a list of keys and types, and they could even script a function that does a custom calculation and add it to the system.
The system will now run defined data transformations without you having to compile a new system or "hard-code" any models to a specific report.
In theory this could mean you use a lot less code to get a system that processes 20 different reports, rather than having to code out the implementation for each report by itself.
Instead of having to add a new database table, you would just save a new JSON configuration model (for example) that describes a new data set and a new set of rules or steps that you want to run as transformations on that data set. You may also provide a new script that pairs with one of the rules or steps in your configuration model.
So what am I describing here, if the word "hard-coded" is used when you define a value in code, what is the word for when you define a variable name in code?
I know it's more than just DRY, and just "configuration" doesn't seem specific enough.
TL;DR How do I look up resources on the pros and cons of writing an engine versus "hard coding" some specific functionality, and is there a better term besides "hard coding" for this concept?