Declarative framework
You declare what you want, rather than walking the computer through what to do. The latter is referred to as imperative programming.
Python is famous for being very declarative - good and bad. It looks like magic, but it makes things very easy to get done.
Declarative frameworks are helpful if you have:
Three primary components of a declarative framework
Managing options
primary purpose of an options container is to store and manage options for a given class declaration.
Options are simply a map of names to values.
call it options.py. The bulk of work is done in the __init__() method.
Options should have defaults so users don’t have to keep declaring the most common thing. If something is truly required and doesn’t have a reasonable default, it should be supplied as an argument, rather than being an option.
Defining fields
containers for data:
databases call them columns
forms call them inputs
functions call them arguments.
Fields are part of the declaration and assigned as attributes on the class. Since they’re instantiated as part of the declaration, all the work has to be done in __init__().