user-pic

trp

Subscribe to feed Recent Actions from trp

  • Sid Burn commented on Inheritance is Bad: Code Reuse Part I

    Yes,
    interfaces solve Part of it. The Problem is that interfaces itself don't have Code Reuse because their are just interfaces.

    In Part II i describe a solution with Roles. That somewhat gives you what interface have plus an implementation.

    But in Part III i also explain the drawbacks of Roles and that it also makes sense to use Composition instead of Roles.

  • mssestak commented on Inheritance is Bad: Code Reuse Part I

    Term you are searching for is tetrapod (or Tetrapoda), which includes amphibians, reptiles, birds, and mammals :).
    See here on Encyclopedia of Life: http://eol.org/pages/4712200/overview .
    BTW, Nice series of articles.

  • Sid Burn commented on Inheritance is Bad: Code Reuse Part I

    "Tetrapod" is only for 4-legged animals. For example a snake can also swim and move on the land, but is not a Tetrapod.

    I think one of the main thing i want to explain here is: Even if you find a term to describe something it makes more sense to just use the behaviour names. Because the pure simple behaviour names will never "collide" with something. That means you want to use the behaviour coded in a class but it doesn't make sense to inherit from it.

    If you want to reuse your "swim-movement" in an u-boot you just can do that. Inheriting from "Tetrapod" will probably not mak…

Subscribe to feed Responses to Comments from trp

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.