NHibernate in Action (Parte 1)
-
Upload
dotnetmarche -
Category
Technology
-
view
129 -
download
1
description
Transcript of NHibernate in Action (Parte 1)
Domain Model PatternDomain Model Pattern
Perché usare un ORM?Perché usare un ORM?
Il progetto NHibernateIl progetto NHibernate
Perché NHibernate?Perché NHibernate?
Per iniziare… Mapping Per iniziare… Mapping delle Entity!delle Entity!
oppure
generato automaticamente
ConfigurazioneConfigurazione
...Configuration cfg = new Configuration();cfg.AddAssembly(“Sample");factory = cfg.BuildSessionFactory();...
<configSections> <section name="nhibernate" type=“..." /></configSections><nhibernate> <add key="hibernate.connection.provider" value=“..." /> <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" /> <add key="hibernate.connection.driver_class" value=“..." /> <add key="hibernate.connection.connection_string" value=“….connectionString..." /></nhibernate>
La SessionLa Session
Entity LifecycleEntity LifecycleSpazio della vostra applicazione
TRANSIENTTRANSIENTPERSISTENT
PERSISTENT
DETACHED
DETACHED
PERSISTENT
PERSISTENT
DETACHED
DETACHED
Transparent Write Transparent Write BehindBehind
sessio
n
Sch
edule
d a
ctio
ns
Dirty CheckingDirty Checking
...
Anagrafica.DataNascita = ...Anagrafica.Indirizzo.Cap = “...”
...
Gestione della Gestione della concorrenzaconcorrenza
Per aiutarvi con i file Per aiutarvi con i file di mapping…di mapping…
Codename Supertanga
NHibernate Domain Mapper is a tool that assists user creating NHibernate Mapping Files. User may add his own Domain Model assemblies and map them to database table using a rich UI, which will present him all the suitable options regarding at the element type he created. The peculiarity of this tool is that it allows doing the mapping task starting from a domain model instead of a Database schema.
Homepage su Codeplex:http://www.codeplex.com/NHDomainMapper
Se avete un po’ di tempo da dedicarci…
entrate a far parte del team di sviluppo, fama e gloria vi attendono!!
Domande?