Manual DAL & BLL vs. ORM

后端 未结 8 1110
再見小時候
再見小時候 2021-02-03 15:21

Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work wi

相关标签:
8条回答
  • 2021-02-03 15:52

    As others explain, there is a fundamental difficulty with ORM's that make it such that no existing solution does a very good job of doing the right thing, most of the time. This Blog Post: The Vietnam Of Computer Science echoes some of my feelings about it.

    The executive summary is something along the lines of the assumptions and optimizations that are incompatible between object and relational models. although early returns are good, as the project progresses, the abstractions of the ORM fall short, and the extra overhead of working around it tends to cancel out the successes.

    0 讨论(0)
  • 2021-02-03 15:55

    Perhaps a little of both is the right fit. You could use a product like SubSonic. That way, you can design your database, generate your DAL code (removing all that boring stuff), use partial classes to extend it with your own code, use Stored Procedures if you want to, and generally get more stuff done.

    That's what I do. I find it's the right balance between automation and control.

    I'd also point out that I think you're on the right path by trying out different approaches and seeing what works best for you. I think that's ultimately the source for your answer.

    0 讨论(0)
提交回复
热议问题