koger wrote:
Hello
I'm starting on a project and being new to ORM tools and almost new to databases in general.
I'm wondering if I should use a ORM tool or code generate something or simply do it manually myself.
Thanks
No one has mentioned the ability to separate your 'Domain Model' from your DataTables... I thought this was the main reason?
Really, the only true advantage, to me (as I currently know it) is that I'm writing lots of C# code where my business logic/formulas etc are isolated in my domain model - in code.
Which means, I can test it in isolation, without a database, and then when it comes to hitting the database, I'll use another layer of my application to run the queries.
Separation of concerns etc; anyone else with me here...?
In which case, I'm going to say that I don't agree at all with farzad's statement saying
Quote:
If you find you are gonna need to mostly retrieve data instead of updating/inserting then many an ORM tool is not best suitable for you
... is way off the mark.
You use an ORM tool so you can keep your business logic in your code, and out of duplicated/unrepresentative/unmaintanable/waste-of-time SQL/stored-proc files. (I say 'waste' in the context of an ORM application where some queries using QBE could save writing 100 lines of SQL).
It becomes less useful, when you're doing very large/bulk updates, or when your domain model is not very complex or your application is just very small and simple. In those situations, I would consider skipping the use of ORM.