¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Generics

Jose Juan Ramírez Español

Contenido del mapa

Generics

  1. Generics

    • Type parameter: placeholder for a type declared in a generic
    • Type argument: actual type used to parametrize a generic
  2. Generic Constrainst

    • Type parameter bound: limit possible values of type argument. We need to explicity define a type parameter upper bound
    • Nullabilty: non-nullable and nulable types as type argument. We need to explicity define a non-nullable type explicity
  3. Variance

    • Modifiers
      • Covariant: subtyping is preserved
        • out
      • Contravarient: reversed
        • in
      • Invariant: ignored. Default
    • Place in the code
      • use-site
      • declaration-site
    • Collection
      • Invariant by default
      • List: co-variant
      • MutableList: invariant
    • Limitation: only limited to a single position
      • in: method parameters
      • out: method return value
    • Constructor
      • parameters are always invariant
  4. Type erasure

    • Process of removing a type argument from a generic type
      • JvmName to change the name of one of the methods
    • Reified
      • special modier that can preserve a type-argument at runtime
      • only with inline functions
  5. Star-projections

    • way to say that information about type argument is missing or it is not important
  6. programming style where classes, fuctions, data structures or algorithms are written in such way that the exact type can be specified late

Información

Descripción
Mapa Mental sobre Generics, creado por Jose Juan Ramírez el 12/01/2018.
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?