Skip to content
aipatterns.dev

Category

Other Smells

Smells that do not fit the main groups, currently the gap left when a library class you cannot edit lacks an operation you need.

What these smells share

This group holds smells that cross the boundaries of the main categories. The current member concerns code you do not own. You cannot refactor a third-party or generated class directly, so the usual moves, such as adding a method where the data lives, are not available. The smell is in how your code works around that limit.

Members

  • Incomplete Library Class: a library type lacks a method you need, and workarounds for it are duplicated across your code.

How to choose within this category

For agents

  • Check whether an installed dependency or a newer version of the library already provides the operation before writing one.
  • Use the language's extension mechanism where one exists: C# extension methods, Kotlin extension functions, Swift extensions, Rust traits.
  • Never patch the library's prototype or vendored source to add the method.

In this category

See also

Original writing and examples. Topic coverage follows Refactoring.Guru, which explains this topic with its own illustrations.