Questions tagged [nhibernate]
31 questions
28
votes
4 answers
What are the most common mistakes and anti-patterns NHibernate user programmers make?
What are the most common mistakes and anti-patterns NHibernate user programmers make? Please explain why those are bad practices or give link to resource for further reading.
For example:
One anti-pattern common for new NHibernate programmers is to…

Darius Kucinskas
- 391
- 1
- 4
- 9
20
votes
7 answers
Is writing your own Data Access / Data Mapping Layer a "good" idea?
We're currently in a situation where we have a choice between using an out-of-the-box object-relational mapper or rolling our own
We have a legacy application (ASP.NET + SQL Server) where the data-layer & business-layer are unfortunately mashed…

Eoin Campbell
- 2,118
- 1
- 17
- 17
15
votes
5 answers
If Repository Pattern is overkill for modern ORMs (EF, nHibernate), what is a better abstraction?
I've recently read a lot of arguments against using the repository pattern with powerful ORM's like Entity Framework as it incorporates repository-like functionality, along with Unit of Work functionality as well.
Another argument against using…

AnotherDeveloper
- 363
- 3
- 10
13
votes
2 answers
Why is the Repository pattern needed in NHibernate?
I am reading the official Your first NHibernate based application.
While the tutorial is good and easy to follow, I am wondering why the Repository pattern is used.
In the various Add, Update, Remove methods in the ProductRepository implementation,…

Zabba
- 321
- 2
- 5
11
votes
3 answers
DDD with ORM where should the business logic go?
I have used an MDA (model driven architecture) tool in the past where we modeled via UML and this generated the business entities (our domain model) and the ORM (mapping etc) amongst other things.
A lot of the business code and services working on…

JD01
- 1,279
- 2
- 13
- 20
8
votes
3 answers
What is the "best" way to approach validation from the perspective of a DDD purist?
I recently asked this question.
I am trying to decide where to put the validation in a DDD app. I believe it should be done at every layer.
I am now concentrating on the Domain model. I was expecting validation to go in the Setter methods like…

w0051977
- 7,031
- 6
- 59
- 87
8
votes
2 answers
EF vs. NHibernate
In the past 2 years since I started writing business applications (before I did either high level front end or very low level systems programming), learned datasets, linq to sql, and now entity framework. The logical thing to look at next seems to…

Aaron Anodide
- 5,463
- 5
- 28
- 37
7
votes
1 answer
Why should I use Iesi.Collections instead of the traditional System.Collection?
Was research on how (for convetion) define a Many Many where table where both fields are primary key and found this post.
So decide to install the Iesi.Collections in my library domain.
But there came a doubt. In the "Iesi.Collections" outperforms…

ridermansb
- 225
- 2
- 9
5
votes
1 answer
Should I Use an ORM only when dealing with Data Model objects?
I am new to ORM, and we started developing a new system using NHibernate as the ORM.
I think this question may refer to any ORM and any language/platform.
The Team Leader has said we should use NHibernate only when retrieving our domain data model…

Mithir
- 1,339
- 3
- 13
- 23
4
votes
1 answer
What specific features of NHibernate cause it to be recommended for legacy database systems?
So, I've been evaluating Entity Framework and NHibernate (I'm not looking for an EF vs. NH battle here, though!).
One thing that I see come up very often is that NHibernate is recommended for "legacy"/brownfield database projects, and lighter-weight…

JMarsch
- 351
- 1
- 9
3
votes
2 answers
Should I use nhibernate for a one row settings table
I am using nhibernate in a quite big project.
The system has a settings table which has 10 columns and one row, there is always a row and it should not be deleted only modified.
Concurrency can be a problem as many clients can increment columns in…

Jakob
- 213
- 2
- 10
3
votes
3 answers
Abstracton layer to control services access to denormalized db entity
Our db is optimized for minimum join count (partially denormalized). E.g. our User entity contains account data (nickname, facebook id, etc), user numerical statistics (total games played, total wins, etc), guild related user information (guild id,…

Vlad
- 311
- 2
- 11
3
votes
0 answers
How to implement DDD in a distributed application with NHibernate?
I have an ASP.NET MVC web site working in this way:
(In the controller)
var user = _applicationService.GetUserById(1);
user.ChangeEmail("mynemail@somewhere.com");
user.ChangeAddress("my new street", "21");
(In a HttpModule)
void EndRequest(){
…

Apocatastasis
- 215
- 1
- 5
3
votes
2 answers
Is Microsoft's Entity Framework a proprietary variant of NHibernate?
I have no knowledge of Entity Framework and NHibernate but definitely want to learn. I want to know how to start. Whether to first read documentation of NHibernate or the default Visual Studio Entity Framework?
Is Microsoft's Entity Framework a…

RPK
- 4,378
- 11
- 41
- 65
3
votes
2 answers
NHibernate and complex domain model against a legacy database
I'm trying to refactor (actually, rewrite) an application which currently uses only stored procedures to access the database (hundreds of SPs). My goal is to use Nhibernate and follow a good design as much as possible.
But since the database (and…

Dawmz
- 29
- 1
- 3