abstraction
A simplified description of what something does, such as an interface, that hides how it does it.
In more detail
Code that depends on an abstraction can work with any implementation of it, which makes parts easy to swap and test. A good abstraction speaks in the caller's terms; a poor one merely renames the thing it wraps.
Examples
C#: registering IProductRepository against SqlProductRepository in the dependency injection containerIn Python, a function with parameters is abstraction in action: happyBirthday(person) works for any name.Related terms
- interface — A named set of member signatures that a type promises to implement, with no state of its own.
- dependency injection — Giving an object the collaborators it needs from outside, usually through its constructor, instead of letting it create or look them up itself.
- repository pattern — Putting all the code that reads and writes one kind of data behind a single object, so the rest of the app never talks to the database directly.
- function — A named, reusable block of code that takes inputs, called arguments, and can return a result.
- parameter — A name in a function definition that receives the value of an argument each time the function is called.
Taught in
- The Dependency Injection Container: Scopes and Lifetimes — Modern .NET Core, C# & Enterprise Microservices
- The Repository Pattern — Modern .NET Core, C# & Enterprise Microservices
- Function Parameters — Hands-on Python: Complete Video Course & Book
- Mad Libs Revisited: The Whole Program — Hands-on Python: Complete Video Course & Book