source(file.path(usethis::proj_get(), "vignettes", "_common.R"))

R6P package logo

CRAN
status Codecov test coverage R-CMD-check

# knitr::include_graphics("https://i.imgur.com/q8GRJll.png")

Intentions

stop("Most functions and classes provided by the `R6P` package are not useful by themselves. This is because design patterns are employed in a specific context. `R6P` implementations are designed for demonstration purposes. Instead of directly using the design pattern as they appear in the package, you'd have to adjust the source code (provided in the examples) to the problem you are trying to solve.")

Introduction

r read.dcf("DESCRIPTION", "Description")[[1]]

This package is based on the work of Gamma1995, and Fowler2002.

Should I use design patterns?

::: {.alert .alert-info} Design patterns represent an alternative to design: rather than designing a new mechanism from scratch, just apply a well-known design pattern. For the most part, this is good: design patterns arose because they solve common problems, and because they are generally agreed to provide clean solutions. If a design pattern works well in a particular situation, it will probably be hard for you to come up with a different approach that is better. :::

::: {.alert .alert-warning} The greatest risk with design patterns is over-application. Not every problem can be solved cleanly with an existing design pattern; don't try to force a problem into a design pattern when a custom approach will be cleaner. Using design patterns doesn't automatically improve a software system; it only does so if the design patterns fit. As with many ideas in software design, the notion that design patterns are good doesn't necessarily mean that more design patterns are better. :::

Installation

You can install the released version of R6P from CRAN with:

install.packages("R6P")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("tidylab/R6P")

References



tidylab/R6P documentation built on Dec. 23, 2024, 9:22 a.m.