nhibernate architecture -
hello want create first nhibernate projet. migration winform project associated old dataacess no strong orm mapping. project quite large i'd have architecture beginning.
i have layer :
- repository : create session nhibernate
- model : bean object, consists of getter / setter properties same name in database
but i'll need advices, how handle operations ? if want create item should access directly nhibernate code ? or should create business logic layer ?
basically found simple architecture business layer. http://www.codeproject.com/kb/architecture/nhibernatearchitecture.aspx feeling ?
another question, program strong validation (glasses domain), should validation ? in winform project or in business layer ?
it's hard , give useful advices without seeing project , actual problems. client-server architecture instance? mean "quite large"? there many different projects have rules fit all.
generally:
- in of cases, useful have business layer.
- validation should in business layer. there nhibernate validation , other validation frameworks around, allow declarative validation.
the common mistake see when starting nh people don't understand persistence ignorance. means should write business logic without accessing database or nh. changes made on entities, not "temporarily" until explicitly applied database, implicitly stored when transaction gets committed. has huge impact code. in many cases, there no "store" or "update" or whatever.
Comments
Post a Comment