The ORM Dilemma

  • David Portas (5/12/2010)


    Just to clear up one potential point of confusion. The editorial and this thread are about O/RM (Object/Relational Mapping).

    ORM[/url] (Object Role Modelling) is something entirely different and unrelated that unfortunately shares the same initials. ORM is more useful and more fun than O/RM. 🙂

    Excuse me, but I don't see any '/'s in the editorial. I must be getting old.....:cool:

  • Great points Steve. Developers should take the time to work with dbas in order to generate "SCHEMA BASED" frameworks. SQL 2008 has features that make generating "SET BASED" CRUD an achievable goal. How about TVP? Yep, Table-Valued Parameters. SQL 2008 allows the creation of table types that can be passed as TVP's to a function or stored procedure. SQL 2008 allows the creation of stored procedures that use TVP's. Table types can be populated with data and passed to stored procedures.

    There is no need to get all worked up over changes to tables or stored procedures. Let's ease the maintenance issues by querying the views in the "information_schema" schema. While we're at it let's map the sql types to the .net data types. It is almost criminal to see these orms fail to generate efficient CRUD statements. I know there are some rock stars out there so I'll tip the old hat to you by openly admitting that it is indeed possible to generate efficient TVP based stored procedures that ALSO utilize "Optional Parameters" in stored procedures. Yep...that's one sproc for "select", one sproc for "upsert", and one sproc for "delete".

    Developers can work with partial classes that are generated and store handwritten code in a separate file....Just like the OLD tried and true winforms. So you want to get some data. Declare a strongly-typed table variable, add ONE record to the table, and get some data back based on the properties that you "Optionally" filled. I know great minds think alike and you are correct for wanting to perform a little linq on the results. I think I'll turn this post into an article. I've been lurking here since 6/4/2003. It's about time I weighed in with something that was made with the help of the information learned from this awesome site...stay tuned.

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply