First page Back Continue Last page Graphics

Interaction Between Views and Entities: Retrieving Data


Notes:

Interaction Between Views and Entities: Retrieving Data

A view object typically gets its data by using a SQL query, and a view object is usually bound to an entity object. This slide should help to explain these two apparently conflicting pieces of information. View objects and entity objects work together when a view object retrieves data:

The view object queries the database, ensuring that its data is current.

Data retrieved by the query is saved to the entity object’s cache.

Calculated Attributes

A calculated attribute is based only on a database query, not on an entity object’s attribute. Calculated attributes get their data directly from a column expression in the SQL query; the data is stored in the view object’s cache.

Entity Objects

The data is passed to the entity object to validate business rules stored in the object. The view object determines what data is retrieved. The entity object guarantees that the data follows the defined business rules.

Synchronization

Values in view object rows and entity object rows remain coordinated.