- Write a stored procedure to access the tables.
- Write the code in the dataaccess layer to call the stored procedure (thank goodness we were using the Enterprise Library which simplified that code)
- Write a business layer routine to call the data access layer
Death by n-tier. I guess if the business layer added any value, I could understand it, but it didn't.
I was introduced to SubSonic. SubSonic is a data layer generator that implements the ActiveRecord pattern. In a nutshell, it automatically generates the code to present your application with strongly typed data objects and collections based on your database design. It can operate in two modes: mode one automatically updates the code datlayer code for you at compile time using their build provider. This is cool, becuase you can update your database and the changes are automatically refelected in your code the next time you compile.
I prefer mode 2 where Subsonic generates code for you and places it into a separate data layer project. You have to go through some extra steps, but this method just feels better to me. This mode is also recommended if you are going to be deploying to a shared host.
SubSonic also provides a Scaffolding control that can help you prototype your data input logic quickly.
I'm by no means an expert on this stuff. But SubSonic seems like a good tool to have in your tool box.

0 comments:
Post a Comment