Skip to content

Evolution vignette #143

Closed
Closed

Description

@hadley

Need a vignette that systematically works through ways that classes and generics might change:

  • Generic adds an argument
  • Generic removes an argument
  • Generic changes name
  • Generic changes package
  • Class adds a property (incl. potential to clash with subclasses)
  • Class removes a property (incl. deprecation with active property)

This will be useful for future users, and will force us to ensure that we've fully thought through the key cases.

Activity

  1. lawremi commented on Feb 7, 2022

    @lawremi
    Collaborator

    Let's also include some guidance around how to design classes and generics so as to mitigate the impact of any changes. For example, limiting the number of arguments to the generic and using composition to isolate property changes in helper classes.

    Based on past experience, these situations arise rarely, and when they do, the best solution is just to work with downstream dependencies to update them. The most important thing to get right is detecting conflicts and inconsistencies when they occur.

  2. hadley commented on Feb 7, 2022

    @hadley
    MemberAuthor

    @lawremi I suspect there's a different between BioC and CRAN here — when evolving an interface of a CRAN package, it's really nice to be able to avoid requiring simultaneous package releases. So while most of the time you do end up working with the downstream maintainers to fix the problem, it's nice to not have R CMD check fail while the packages are slightly out of sync.

  3. hadley commented on Feb 10, 2022

    @hadley
    MemberAuthor

    One last note: when you change a generic() it's nice to be able to still successfully source the whole package so that you can fix methods one-by-one, rather than having to update them all before your package re-loads successfully.

  4. added a commit that references this issue on Oct 6, 2026
    7c56e79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions