Anti-pattern

Last updated

An anti-pattern in software engineering, project management, and business processes is a common response to a recurring problem that is usually ineffective and risks being highly counterproductive. [1] [2] The term, coined in 1995 by computer programmer Andrew Koenig, was inspired by the book Design Patterns (which highlights a number of design patterns in software development that its authors considered to be highly reliable and effective) and first published in his article in the Journal of Object-Oriented Programming. [3] A further paper in 1996 presented by Michael Ackroyd at the Object World West Conference also documented anti-patterns. [3]

Contents

It was, however, the 1998 book AntiPatterns that both popularized the idea and extended its scope beyond the field of software design to include software architecture and project management. [3] Other authors have extended it further since to encompass environmental, organizational, and cultural anti-patterns. [4]

Definition

According to the authors of Design Patterns, there are two key elements to an anti-pattern that distinguish it from a bad habit, bad practice, or bad idea:

  1. The anti-pattern is a commonly-used process, structure or pattern of action that, despite initially appearing to be an appropriate and effective response to a problem, has more bad consequences than good ones.
  2. Another solution exists to the problem the anti-pattern is attempting to address. This solution is documented, repeatable, and proven to be effective where the anti-pattern is not.

A guide to what is commonly used is a "rule-of-three" similar to that for patterns: to be an anti-pattern it must have been witnessed occurring at least three times. [5]

Uses

Documenting anti-patterns can be an effective way to analyze a problem space and to capture expert knowledge. [6]

While some anti-pattern descriptions merely document the adverse consequences of the pattern, good anti-pattern documentation also provides an alternative, or a means to ameliorate the anti-pattern. [7]

Software engineering anti-patterns

In software engineering, anti-patterns include the big ball of mud (lack of) design, the god object (where a single class handles all control in a program rather than control being distributed across multiple classes), magic numbers (unique values with an unexplained meaning or multiple occurrences which could be replaced with a named constant), and poltergeists (ephemeral controller classes that only exist to invoke other methods on classes). [7]

Big ball of mud

This indicates a software system that lacks a perceivable architecture. Although undesirable from a software engineering point of view, such systems are common in practice due to business pressures, developer turnover and code entropy.

The term was popularized in Brian Foote and Joseph Yoder's 1997 paper of the same name, which defines the term:

A Big Ball of Mud is a haphazardly structured, sprawling, sloppy, duct-tape-and-baling-wire, spaghetti-code jungle. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated.

The overall structure of the system may never have been well defined.

If it was, it may have eroded beyond recognition. Programmers with a shred of architectural sensibility shun these quagmires. Only those who are unconcerned about architecture, and, perhaps, are comfortable with the inertia of the day-to-day chore of patching the holes in these failing dikes, are content to work on such systems.

Brian Foote and Joseph Yoder, Big Ball of Mud. Fourth Conference on Patterns Languages of Programs (PLoP '97/EuroPLoP '97) Monticello, Illinois, September 1997

Foote and Yoder have credited Brian Marick as the originator of the "big ball of mud" term for this sort of architecture. [8]

Project management anti-patterns

Project management anti-patterns included in the Antipatterns book include:

See also

Related Research Articles

Spaghetti code is a pejorative phrase for difficult-to-maintain and unstructured computer source code. Code being developed with poor structure can be due to any of several factors, such as volatile project requirements, lack of programming style rules, and software engineers with insufficient ability or experience.

<span class="mw-page-title-main">Software architecture</span> High level structures of a software system

Software architecture is the set of structures needed to reason about a software system and the discipline of creating such structures and systems. Each structure comprises software elements, relations among them, and properties of both elements and relations.

In software engineering, a design pattern describes a relatively small, well-defined aspect of a computer program in terms of how to write the code.

Software design is the process of conceptualizing how a software system will work before it is implemented or modified. Software design also refers to the direct result of the design process – the concepts of how the software will work which consists of both design documentation and undocumented concepts.

Software development is the process used to create software. Programming and maintaining the source code is the central step of this process, but it also includes conceiving the project, evaluating its feasibility, analyzing the business requirements, software design, testing, to release. Software engineering, in addition to development, also includes project management, employee management, and other overhead functions. Software development may be sequential, in which each step is complete before the next begins, but iterative development methods where multiple steps can be executed at once and earlier steps can be revisited have also been devised to improve flexibility, efficiency, and scheduling.

The following outline is provided as an overview of and topical guide to software engineering:

In engineering, a requirement is a condition that must be satisfied for the output of a work effort to be acceptable. It is an explicit, objective, clear and often quantitative description of a condition to be satisfied by a material, design, product, or service.

In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard way to build and deploy applications and is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate the development of software applications, products and solutions.

The concept of design paradigms derives from the rather ambiguous idea of paradigm originating in the sociology of science, which carries at least two main meanings:

In the context of software engineering, software quality refers to two related but distinct notions:

<span class="mw-page-title-main">Computer-integrated manufacturing</span> Manufacturing controlled by computers

Computer-integrated manufacturing (CIM) is the manufacturing approach of using computers to control the entire production process. This integration allows individual processes to exchange information with each part. Manufacturing can be faster and less error-prone by the integration of computers. Typically CIM relies on closed-loop control processes based on real-time input from sensors. It is also known as flexible design and manufacturing.

This is an alphabetical list of articles pertaining specifically to software engineering.

Software project management is the process of planning and leading software projects. It is a sub-discipline of project management in which software projects are planned, implemented, monitored and controlled.

Model-driven engineering (MDE) is a software development methodology that focuses on creating and exploiting domain models, which are conceptual models of all the topics related to a specific problem. Hence, it highlights and aims at abstract representations of the knowledge and activities that govern a particular application domain, rather than the computing concepts.

An architectural pattern is a general, reusable resolution to a commonly occurring problem in software architecture within a given context. The architectural patterns address various issues in software engineering, such as computer hardware performance limitations, high availability and minimization of a business risk. Some architectural patterns have been implemented within software frameworks. There are two main categories of architectural patterns: monolithic and distributed.

In software development and other information technology fields, technical debt is the implied cost of future reworking because a solution prioritizes expedience over long-term design.

<span class="mw-page-title-main">Oscar Nierstrasz</span> Swiss-Canadian software engineer and programmer

Oscar Marius Nierstrasz is a professor at the Computer Science Institute (IAM) at the University of Berne, and a specialist in software engineering and programming languages. He is active in the field of programming languages and mechanisms to support the flexible composition of high-level, component-based abstractions, tools and environments to support the understanding, analysis and transformation of software systems to more flexible, component-based designs, secure software engineering, and requirement engineering to support stakeholders and developers to have moldable and clear requirements. He has led the Software Composition Group at the University of Berne since 1994 to date.

<span class="mw-page-title-main">Object-oriented programming</span> Programming paradigm based on the concept of objects

Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code: data in the form of fields, and code in the form of procedures. In OOP, computer programs are designed by making them out of objects that interact with one another.

In computer programming, a design smell is a structure in a design that indicates a violation of fundamental design principles, and which can negatively impact the project's quality. The origin of the term can be traced to the term "code smell" which was featured in the book Refactoring: Improving the Design of Existing Code by Martin Fowler.

References

What supports what

  1. Budgen 2003, p. 225.
  2. Ambler 1998, p. 4.
  3. 1 2 3 Neill, Laplante & DeFranco 2011, p. 4.
  4. 1 2 Neill, Laplante & DeFranco 2011, p. 5.
  5. Neill, Laplante & DeFranco 2011, p. 6.
  6. Jimenez 2006.
  7. 1 2 Demeyer 2008, p. 102.
  8. Foote, Brian; Yoder, Joseph (26 June 1999). "Big Ball of Mud". laputan.org. Retrieved 14 April 2019.

Sources

  • Neill, Colin J.; Laplante, Philip A.; DeFranco, Joanna F. (2011). Antipatterns: Managing Software Organizations and People. Applied Software Engineering Series (second ed.). CRC Press. ISBN   9781439862162.
  • Budgen, D. (2003). Software design. Harlow, Eng.: Addison-Wesley. p. 225. ISBN   0-201-72219-4. As described in Long (2001), design anti-patterns are 'obvious, but wrong, solutions to recurring problems'.
  • Ambler, Scott W. (1998). Process patterns: building large-scale systems using object technology. Cambridge, UK: Cambridge University Press. p. 4. ISBN   0-521-64568-9. ...common approaches to solving recurring problems that prove to be ineffective. These approaches are called antipatterns.
  • Jimenez, Edward (2006-04-24). "AntiPatterns". AntiPatterns. Retrieved 24 April 2006.
  • Demeyer, Serge (2008). "ObjectOriented Reengineering". In Mens, Tom; Demeyer, Serge (eds.). Software Evolution. Springer Science + Business Media. ISBN   9783540764403.

Further reading