NHibernate vs .netTiers

3,816 views

Published on

NHibernate and .netTiers compared

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,816
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

NHibernate vs .netTiers

  1. 1. NHibernate vs netTiers<br />Guilherme Balena Versiani <guibv@comunip.com.br><br />
  2. 2. Open-Closed principle<br />Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification<br />Comparing principles<br />Meyer, Bertrand (1988). Object-Oriented Software Construction. Prentice Hall. ISBN 0136290493.<br />
  3. 3. Low coupling means low dependency between each program module.<br />High coesion means that the functionality expressed by the source code of a software module is strongly-related.<br />Comparing principles<br />W. Stevens, G. Myers, L. Constantine, "Structured Design", IBM Systems Journal, 13 (2), 115-139, 1974.<br />
  4. 4. .netTiers<br />Define the database schema, the engine (CodeSmith Generator) will generate the source code for you.<br />NHibernate<br />Define your models classes, define your database mapping using a XML config file; NHibernate can generate the schema for you, if you want.<br />NHibernate vs .netTiers<br />
  5. 5. .netTiers<br />Change the database schema and re-generate the cource code. Never touch the generated code.<br />Caution modifying the database schema.<br />NHibernate<br />Change the models without the need to touch the XML config file, change the XML config file without any model change.<br />Change some aspects of the schema without any compromise of the source code.<br />NHibernate vs .netTiers<br />
  6. 6. .netTiers<br />High coupling between the database, the generated source code and the generator tool (CodeSmith Generator).<br />NHibernate<br />Low coupling between the database and the source code, through the use of the config file.<br />It is even possible to change the database/config file with no touch over the assemblies!<br />NHibernate vs .netTiers<br />
  7. 7. NHibernate vs .netTiers<br />
  8. 8. A Feature-driven Comparison of Entity Framework and NHibernate-2nd Level Caching – http://dotnetslackers.com/articles/ado_net/A-Feature-driven-Comparison-of-Entity-Framework-and-NHibernate-2nd-Level-Caching.aspx.<br />First and Second Level caching in NHibernate –http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/11/09/first-and-second-level-caching-in-nhibernate.aspx.<br />.netTiers website, FAQ and Documentation –http://nettiers.com/.<br />References<br />

×