Learn R Programming

futile.paradigm (version 1.0.0)

crud: API for CRUD-like operations

Description

Provides a high-level API for abstracting CRUD operations for arbitrary objects.

Usage

create(x, ...)
create.default(type, ...)
access(x, ...)
update(x, ...)
delete(x, ...)

Arguments

x
An arbitrary object
type
A string that represents a type
...
Additional arguments to pass to dispatched functions

Value

  • 'create' returns an object of the requested type.

    'access' returns an object of the requested type.

    'update' has no return value.

    'delete' has no return value, but the given object is removed from the environment.

Details

Adding to 'create' requires a minimal function definition as the harness is provided in the package. Typically a list is returned and the function defines any defaults needed. This is similar to the S4 style but is simpler and not a requirement for using the rest of futile.paradigm.

Examples

Run this code
create.car <- function(x, wheels=4) list(wheels=wheels)
create(car)

Run the code above in your browser using DataLab