Skip to content
Noah Goodrich edited this page Aug 13, 2012 · 13 revisions

GacelaPHP - The Swift DataMapper

Why Gacela?

Gacela presents several new approaches to the common problem of building an object-relational-mapper layer and the domain layer in an application.

In general, other ORM solutions either require that you use a code generation tool to get generated meta information in your ORM objects or they require that you hand code that meta information.

Gacela takes the approach of loading as much meta data from the data source as possible. This is possible by providing conventions for the structure of the data from the data source and then using those conventions along with methods provided by the data source for discovering meta data.

Additionally, because Gacela divides its responsibilities between several types of classes, it is possible for Gacela to load each Mapper once as well as the DataSources and Resources that provide the Mappers with the information necessary to provide data mapping between the Models and the DataSources.

Gacela implements object registries whenever possible so as to avoid loading objects unnecessarily. Thus it relies on a modified Front Controller object (the Gacela class) to load Mappers and DataSources. Resources and Fields are likewise stored in registries so that they are always only loaded once.

Lastly, while the default conventions and usages can be utilized with almost no coding, Gacela provides sufficient flexibility to allow its users to get down to bare metal quickly and utilize straight PHP when necessary.

Getting Started

Clone this wiki locally