HOME

TheInfoList



OR:

RedBeanPHP is an independent, free,
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
licensed, open-source
object–relational mapping Object–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between type systems using object-oriented programming languages. This creates, in effect, a "virtual object databa ...
(ORM) software written by Gabor de Mooij. It is a stand-alone library, not part of any framework. RedBeanPHP is an on-the-fly object relational mapper, this means there is no upfront configuration. The system relies on conventions entirely and adapts the database schema to fit the needs of the program. This way, it strikes a balance between
NoSQL A NoSQL (originally referring to "non- SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed ...
and traditional
RDBMS A relational database is a (most commonly digital) database based on the relational model of data, as proposed by E. F. Codd in 1970. A system used to maintain relational databases is a relational database management system (RDBMS). Many relation ...
solutions.


Features

RedBeanPHP is different from other ORM systems because it requires no configuration in
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
,
YAML YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Exte ...
or
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
. It adapts the database schema based on the needs of the program. All tables and columns are created on-the-fly, without upfront configuration or mapping. It automatically adds columns to tables if necessary and changes the type of the column to match its content requirements. When the developer is done developing and no more schema changes are expected, the schema can be frozen for deployment to production environments. After freezing the database no more schema alterations take place. Relations among tables are mapped in the same way: by convention. For instance, to create a one-to-many relationship between two tables one assigns an array to the property bearing the name of the target table. This automatically creates the table as well as the required columns. Code example, demonstrating a simple CRUD operation and a relation: R::setup(); $movie = R::dispense('movie'); $movie->title = 'Beans in space'; $character = R::dispense('character'); $character->name = 'hero'; $movie->ownCharacterList[] = $character; $id = R::store($movie);


Influence

RedBeanPHP is the first library known to adopt the on-the-fly approach towards ORM. As such it has a big influence on other libraries. RedBeanPHP inspired many other projects to embrace this approach towards object mapping. Similar libraries have appeared for .NET,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
,
Javascript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
,
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
, Erlang,
ColdFusion Adobe ColdFusion is a commercial rapid web-application development computing platform created by J. J. Allaire in 1995. (The programming language used with that platform is also commonly called ColdFusion, though is more accurately known as CF ...
and Objective-C.


Integration

While being an independent library, plugin modules have been developed for various popular frameworks like: Laravel,
CodeIgniter CodeIgniter is an open-source software rapid development web framework, for use in building dynamic web sites with PHP. Popularity CodeIgniter is loosely based on the popular model–view–controller (MVC) development pattern. While controller c ...
, Kohana,
Silex Silex is any of various forms of ground stone. In modern contexts the word refers to a finely ground, nearly pure form of silica or silicate. In the late 16th century, it meant powdered or ground up "flints" (i.e. stones, generally meaning the cl ...
and
Zend Framework Laminas Project (formerly Zend Framework or ZF) is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License. The framework is basically a collection of professional PHP-based packag ...
. Besides integration modules, some frameworks ship with RedBeanPHP out-of-the-box like The Nibble Framework.


History

RedBeanPHP first appeared in 2009 on GitHub. The first publicly available version was 0.3.3. RedBeanPHP has been developed by Gabor de Mooij, a software developer from the
Netherlands ) , anthem = ( en, "William of Nassau") , image_map = , map_caption = , subdivision_type = Sovereign state , subdivision_name = Kingdom of the Netherlands , established_title = Before independence , established_date = Spanish Netherl ...
. Because RedBeanPHP is very accessible and it does not hide the SQL language it is used by Universities to teach database programming. According to a forum post by Gabor himself the library has been inspired by a rant about object relational mapping systems by Ted Neward called the 'ORM, Vietnam of computer science'.


Reception

Based on the reviews and presentations available on the web, the overall reception of RedBeanPHP seems to be positive. However the library is less suitable for projects with existing databases and does not support custom table and column mappings, for instance it is not possible to use table prefixes.Checklist suitable projects on the RedBeanPHP website
/ref> Also, none of the major frameworks has incorporated the library.


See also

*
Propel Propel or propelling may refer to: * Propulsion, to push forward or drive an object forward * Samsung A767 Propel, a mobile phone ** Samsung i627 Propel Pro * Propel Fitness Water, a drink from the makers of Gatorade * Propel (PHP), an object-r ...
* Doctrine * List of object–relational mapping software


References


External links

* {{Official website, https://redbeanphp.com, RedBean official website
Author's Home Page
PHP software PHP libraries Software using the BSD license