• bjornsno@lemm.ee
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    What are you talking about? At least in Java and PHP you can absolutely declare constructor and function parameters as interfaces. As you say that’s exactly what they’re for.

    • fuck_u_spez@lemmy.fmhy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Yeah that’s my point, I don’t see a use for factories here, because it’s possible to just use generic parameters (whether it’s constructors or function arguments).