Skip to content

Namespace collisions: consider R6 instead of S3 #6

@hongooi73

Description

@hongooi73

Just as a matter of design: convenience functions like run, install, copy_from_url etc are good to have, but also highly generic. Because of this, there's a good chance that they will collide with exported functions in other packages. In fact update already collides with the function from stats.

Instead of S3, perhaps consider using R6 to define your dockerfile class. Then you can expose these functions as class methods without having to worry about namespace collisions.

How it would look:

shiny_dockerfile <- Dockerfile$
    new()$
    from("rocker/r-ver:devel")$
    update()$
    install("...")$
    ...

instead of magrittr pipes, you use method chaining, which is basically the same idea expressed in OOP syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions