Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Composition and delegation

Sumit Rawal answered on May 14, 2023 Popularity 2/10 Helpfulness 1/10

Contents


More Related Answers

  • what is functional composition
  • What is Delegation?
  • composition over inheritance
  • delegation

  • Composition and delegation

    0

    If inheritance is really just about reuse (and not about world-building), then that means we can skip the hierarchy entirely and use the techniques of composition and delegation to implement inheritance — Keep in mind that, you can use replace inheritance by dependency injection when you refactor duplications.

    That means we could also refactor the duplication if we have a new car (Ferrari) in our system like this.

    Popularity 2/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 14 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.