Project Description
I've been impressed by the coding efficiencies that can be gained from ORMs like EF or Hibernate. Those tools allow you to embrace change and work in a much more agile way. This is my attempt to produce similar results using good old ADO.Net (which is still my favorite).

AAPL makes it really easy to write data access methods. You just define a query, pick a data shape for the results, pass them both to a DAO (Data Access Object), and the persistence layer does the mappings and other stuff for you. Data access methods wind up looking like this:
        public BlogPost GetBlogPost(Guid postGuid)
            string query = @"SELECT p.*, s.Score 
                            FROM [dbo].[BlogPost] p
                            LEFT JOIN [dbo].[BlogPostReputationScore] s on s.PostGuid = p.PostGuid
                            WHERE PostGuid = @PostGuid";
            SqlDao dao = new SqlDao();
            SqlCommand command = dao.GetSqlCommand(query);
            command.Parameters.Add(dao.CreateParameter("@PostGuid", postGuid));
            return dao.GetSingle<BlogPost>(command);

AAPL is really just some coding conventions coupled with a little scaffolding code. There is a zip file on the downloads page that contains a sample app with all source code, and a db backup. This is not a library that you can just plug into your existing project, but it is an app that demonstrates how the conventions and AAPL code work, and it has all the source code you'll need if you want to copy and paste these techniques into your own app. To run the sample app you will need:
  • Visual Studio 2008
  • ASP.Net MVC Framework V1.0
  • SqlServer 2008 (express is fine)

For detailed descriptions of AAPL, how this code works, and why it's designed the way it is, I'm writing a series of blog posts. The first is

Last edited Jan 31, 2010 at 3:05 PM by rlacovara, version 9