Thursday, July 19

Death to piss-poor DALs!

Just slayed the beast of a well-intended but poorly-implemented Data Access Layer (DAL). A few months back I picked up this project -- a website with a simple webservice API, simple reporting functionality, etc. etc. The original website was outsourced to a company, who in turn outsourced it to Belarus.

Apparently they don't believe in YAGNI (Ya Ain't Gonna Need It) in Belarus. The object oriented (OO) architecture is heavily over-engineered: singletons and factories everywhere (nothing wrong with them, just a little unnecessary) and a weeeeird data access class that is NOT designed for use in ASP.NET.

Desktop apps, maybe, but not web -- it uses a single static instance of a connection for the entire life of the application defeating IIS's connection pooling. If connectivity to the DB server is ever lost for the life of the application, the connection is toast until the application is restarted.

Retarded? Yep. And at first I thought I could swap the DAL out in one fell swoop, only to discover weirdness with a third party data grid they had been using -- rather than just populate these display-only grids with a lightweight SqlDataReader, they are filling a SqlDataAdapter, then grabbing its DefaultView, which then becomes the DataSource for the "SimpleGrid" datagrid.

Simple my ass. Simply retarded.