Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • Answering your last paragraph: of course. You don't even need private methods: public methods themselves are abstractions. Commented Oct 12, 2017 at 15:13
  • 1
    Possible duplicate of What is abstraction? Commented Oct 12, 2017 at 15:14
  • 1
    Note that, if you're looking for a formal definition of abstraction, you might not find one. Abstraction is a mental concept; it is more important to understand what it is and why it is important than it is to achieve a legalistic definition of the word. Commented Oct 12, 2017 at 15:19
  • 3
    Really, almost everything in computing can be considered an abstraction. A variable is an abstraction. A first-class function is an abstraction. A cache is an abstraction. A data bus is an abstraction. A closure is an abstraction. Programming languages are really sophisticated abstractions over machine code. And so forth. Garbage collection is absolutely an abstraction. Commented Oct 12, 2017 at 15:29
  • 1
    As a rule of thumb, if you can refactor a class into an interface without changing a lot of code, your class was pretty well abstracted to start with. I use this a guiding principle in class design. I have learned this is better than building an interface for every class and wait until I'm sure I need one. Commented Oct 12, 2017 at 19:47