Spaghetti Inheritance

Start with a base of WhatIfInheritance concepts. Now when you mix the pasta in a C++ kitchen, apply the CuriouslyRecurringTemplate pattern:

    template< class Inheritme, class Payload >
    struct
  Spaghetti: public Inheritme
  {
     Payload m_aPayload;
     ...
  };

When asked why a Spaghetti generic requires two specific inputs, not one, the author will typically refer you to the excuses listed in the page "WhatIfInheritance".

WaterFall & JobSecurity lifecycles inspire this anti-pattern by convincing the "architect" programmer who fills the common code base up with them that only they are smart enough to know how these classes expect to get re-used. And only they understand that systems like these cannot easily be retrofitted into existing code to upgrade it (RefactorMercilessly), so the expense can only be paid for up front.

Other languages probably support similar needless complexities in these areas...


CategoryAntiPattern


EditText of this page (last edited April 27, 2006) or FindPage with title or text search