1.E’ un algoritmo ricorsivo: Tutti le istanze di
oggetti “raggiungibili” da un oggetto
persistente diventano anch’essi persistenti.
Persistence Context
Soluzione di NHibernate:
Persistence by Reachability con Cascade
Associazione
Cascade
Behaviour
User Interface Layer
Context:
Context
Identity Map
Unit of Work
Automatic Dirty Check
Optimistic Concurrency
Pessimistic Concurrency
Proxy per Lazy...
Business Layer
Context
Data Access Layer
Context Provider
DAO
DAO
DAO
“...Hibernate’s job is to reduce the amount of code you have to write
for the most common 90 percent of use cases (common CRUD and
reporting)...”
“…Hibernate’s learning curve is high at first.
In our experience, a developer needs at least two to four weeks to
learn the basics.
Don’t jump on Hibernate one week before your project deadline.
It won’t save you…”
“…Finally, use SQL, JDBC, and stored procedures for the 5 percent of
use cases
you can’t implement with Hibernate, such as mass data manipulation
or complex reporting queries with vendor-specific SQL functions…”
[Gavin King, Hibernate in Action]
Scarica

Modellare un DAL con un ORM