Mapping objects to relational db_Referential integrity (RI) Flashcards
What is Referential integrity (RI)?
concept about entities references
Formulate Referential integrity concept
if one entity references another then that other entity actually exists
Where can you implement business logic?
in database and in application code
What is Multiple Entity Representation?
entity can be represented in different ways
(For example, customer data can be displayed on an HTML page, be used to create a customer object that resides on an application server, and be stored in the database.)
Not obvious issue with representation of object in several schemas is …
cross schema referential integrity
Common technique to ensure referential integrity is …
to use triggers to implement cascades
what is database trigger?
special stored procedure that is run
When does db trigger run?
when specific actions occur within adatabase
What is cascade?
situation when trigger create action in another table
Where can cascade exist?
db and object
What are the types of db cascades?
delete, insert, update
What are the types of object cascades?
delete, read, save
You can implement cascades in db, objects or …
both
What is lazy reads?
performance enhancing technique
How does lazy reads work?
attributes are defined at the time they are needed
What is cache?
location where copies of entities are temporarily kept
Types of cache are db, object, …
client data
The principle advantage of caches is …
performance improvement.
The principle advantage of caches is …
performance improvement.
Which is the data appropriate for cache?
that is unlikely to change very often
Why can work with cache be complex?
additional logic required
refresh of cache and handling of collisions
What is the risk you run when working with cache?
risk of not committing changes to your database
Can inheritance be factor of RI?
no, it provides RI rules for related objects
How does RI relates to business logic?
RI is part of business logic
Where should RI be implemented?
Objects, db or both
How to choose RI and business logic options?
it’s depends on purposes
there isn’t totally correct answer but there are general strategies how to implement business logic
What do you need to implement RI in your app?
RI and business logic options to choose