-
Notifications
You must be signed in to change notification settings - Fork 6
definitions
Gacela uses a number of objects to provide its automatic relationship loading as well as to make it possible to use different types of data sources.
Gacela can hold references to many data sources at a single time, though the most common and default datasource is the 'db' datasource.
A DataSource represents a specific source of data to be consumed by your application. DataSources can include databases, web services, xml files, other files or anything else you can come up with.
DataSources provide Mappers with access to Resources.
Each type of DataSource will also have its own type of Query object as well as a Resource object that will be utilized when loading discreet resources from the DataSource.
A DataSource contains many Resources. In the case of a database as the DataSource, each table would be considered a Resource. Mappers use Resources to infer the structure of the Resources themselves as well as to infer the structure of a Resource's relationships to other Resources.
A Mapper references a primary Resource but will contain information about related Resources.
Resources contain references to the Fields in the Resource. Currently the following Field types are supported:
- Bool
- String
- Int
- Float
- Date
- Enum
Mappers provide the means whereby Resources are loaded from a DataSource and then mapped into the Models that will be consumed by your application code. Each Mapper within your application will only be loaded once due to Gacela's caching mechanisms.
Models are returned from their respective Mapper and contain your application's business logic. They do not contain data access logic. A discreet object is created for each new Model loaded from Gacela. Once a particular Model has been loaded by its Mapper, the Mapper will return the cached Model afterward if it is requested again.
- Introduction
- Relationships
- Dependents (or Table A and Table B are part of Model A)
- Single Table Inheritance (or Model A and B are both loaded from Table A)
- Concrete Inheritance (or Table B extends Table A)
- Associations (or Has and Belongs to Many)
- Mappers
- Helpers
- Creating custom findX() methods
- Models
- Working with Collections
- Validation