views:

44

answers:

3

I was wondering if anyone knew if there was a performance boost of any kind in C#/ASP.NET due to moving database calls from the code-behind to the underlying business logic class library.

My understanding is that the class library is compiled, whereas the code-behind is interpreted.

+4  A: 

The code-behind is also compiled.

Yuriy Faktorovich
A: 

Outside of a debugger, C# is never interpreted.

There will be no inherent performance difference.

SLaks
While it's not technically interpreted, in 2.0 the vb files are occasionally recompiled on the fly by the server. It'll do that anyway, though, so the performance impact of a few extra lines in there still shouldn't matter much.
cHao
+2  A: 

Like everyone else has stated, performance wise there is no difference, it is all compiled.

For design purposes and re usability you would want all database calls to be located in a separate project which is considered the DAL or data access layer, your business logic layer would sit on top of this and handle the data that is passed from the DAL.

Database => DAL => Business Logic/Entities => Optional Service Layer => Presentation (Your case an ASP site i believe?)

This will lend greatly to upkeep of your solution.

Matthew McDonald
Yeah the solution is laid out as such. I misspoke when I said the database calls were in the code-behind. The database calls are in the DL, which is called via the BL, which was called by the code-behind.
treefrog