2 ms·
It's not just about the source. Frameworks are leaky abstractions by design, they intentionally expose their internals. In Django, for example, you are suppose
by alganet 2y ago
It's not just about the source. Frameworks are leaky abstractions by design, they intentionally expose their internals.
In Django, for example, you are supposed to know what kind of queries it generates. It is documented how queries are generated (an exposed internal).
You have to open it to configure it:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
}
}
And by doing so, you have to acknowledge (in this case) that postgres becomes a known component of the "insides" (even though you are supposed to only interact with the ORM).
A black box doesn't need this kind of stuff. It would have an embedded database instead. Like a plane black box would have its own batteries instead of relying on the plane power supply.
This is all good, I'm all in favor of good clear boundaries between components. The existence of a boundary does not make it a black box though.
That's why I would prefer using the term "encapsulation" when describing the advantages of having an abstraction.