0%
Advanced OOP: abstract, mixins, enums — Chapter 11

Chapter 11 — Advanced OOP: abstract, mixins, enums

Part 1A — Learn Dart · Chapter 11 of 62 · 7 h

Chapter 11 — Advanced OOP: abstract, mixins, enums

Level: intermediate Estimated time: 7 h Prerequisites: Chapter 10 — Encapsulation, inheritance, polymorphism What you will be able to do by the end: design a clean class hierarchy with abstract classes, interfaces, mixins, enums, and extensions, and choose the right tool for each need.


11.0 — Chapter objectives

By the end of this chapter, you will be able to:

  • explain why single inheritance is not always enough;
  • understand what an abstract class is;
  • use the abstract keyword;
  • write an abstract method, that is, a method without a body;
  • understand why an abstract class cannot be instantiated;
  • mix concrete and abstract methods in the same class;
  • understand the notion of an implicit interface, specific to Dart;
  • use the implements keyword;
  • clearly distinguish extends from implements;
  • implement several interfaces on a single class;
  • explain the problem that mixins solve;
  • declare a mixin and apply it with with;
  • apply several mixins and understand the resolution order;
  • restrict a mixin with the on keyword;
  • declare and use an enum;
  • write a switch on an enum;
  • use values, index, and name;
  • write an enhanced enum with properties and methods;
  • add features to an existing type with extension ... on;
  • choose between composition and inheritance;
  • know which tool to use for which need.

Comments

Comments are powered by GitHub Discussions

Sign in with GitHub to join the discussion

Link copied!