Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0To DAL or not To DALTo DAL or not To DAL
Previous
 
Next
New Post
2/6/2007 9:20 PM
 

If you want to connect to another database because of preexisting data (or shared data), DotNetNuke can still save you a lot of code. See:

Connecting to another database



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
2/7/2007 4:16 AM
 
hooligannes 2.0 wrote
 gregfig wrote

Here is why I ask.  I tried with and without the DAL and there are significant performance differences.  Please do not mis-understand, I am not knocking DNN at all.  However, I will take the path of better performance, unless there is some earth-shattering reason to use the DAL that might impact my DNN site in the future.

 

 

AFAIK, the difference comes from the expensive use of reflection to be able to use the Provider model for data access. As others have pointed out, if you don't need to make your module portable, there's no reason whatsoever to use the DNN DAL. Of course you do want to keep a layered design and use your own DAL.

Well actually... The performanse reasons have fallen of the chart some time ago when the core team introduced caching to that area (after reflection discovery), so actually only the first time it's expensive... later it's cached.

As for using or not using it.... I am against it my self as well, from the architecture point of view there are a lot better solutions then the current one (which only advantage in my opinion is that a) it is compatible with DNN, b) it is a known and proven practice for DNN modules and some you can call it de-facto standard).

And the advantage that is being proposed as one of the best why to use your own providers (so DAL, not DAL+) is actually so that you can easily decouple your DAL and switch it with something else... but in reality... how often do you do that (I personally didn't have that need ever.... and I've being doing this for the last 3+ years)?

From the productivity point of view (where DAL+ comes in), there are still much better solutions (e.g. various free o/r mappers, nettiers.com...), but their real difference comes in when you do modules which have more than one or two tables.

So my advice... if you are going to make a small module solution, which does not require big data logic... use DAL+ and generally DNN proposed solutions. If you are building something bigger (don't get me wrong... it CAN be done with DNN DAL and DAL+...) use a real O/R mapper or at least nettiers-like solution.

 


Thanks,
Vladan Strigo
NETMedia

My website: Vladan.Strigo.NET

Vladan.Strigo.NET: Projects
* Advanced VS2005 development approach - BlankModule
* DNN & Microsoft Ajax best practices guidance

Vladan.Strigo.NET: Resources
* Comprehensive list of DNN 4 Module development resources

 
New Post
2/10/2007 7:14 PM
 

First of all... Thank you for your responses...

Secondly, yes, I understand that the DAL approach is one that Microsoft currently touts as best practice, but I guess, where I'm not clear, is whether I am doing something wrong, or if the DNN DAL, or any DAL for that matter is inherently slower.

Test Case:  Pulling 8,000 rows from a 100,000+ rows SQL database table.

Note, that this was done with both the site and the database locally on a Pentium-D with 4 Gig of Memory running Windows XP Pro SP/2.  IIS and SQL 2005 Standard Edition also used in the test.

For the first test, I removed all indexes from the table, and tried pulling the data (using a stored procedure):

    Using DAL:   82 seconds

    Using ye-old Database Connection & command objects: 44 seconds

Adding the Primary key back onto the table, I ran the same two tests again:

    Using DAL:  28 Seconds

    Using ye-old Database Connection & command objects:  19 seconds.

Note that I realize these times seem slow, even with the primary key, however, the Stored Procedure is a little complicated and the original database table setup yields much faster results.  I did this to demonstrate the differences.

   I'm not doing anything out of the ordinary, but it seems like passing through the DAL slows me down significantly.  I have seen that by altering my stored procedures and tables (ie indexes) that are used with the DAL, I can widdle the DAL's performance down to almost the same performance.  The difference is not even worth mentioning at that point.

   I guess the bottom line is, is the DAL really slower, or did it just unveil problems with my stored procedures and indexes that the old Database connection objects didn't really care about?  Perhaps the DAL is teaching me that I suck at writing stored procedures??? 

   I would like to know your thoughts...  In the meantime, I will stick with the DAL, after all, it is what Microsoft touts as the way to go (this year!).

Again, thanks for the responses!!

 
New Post
2/11/2007 9:35 AM
 
gregfig wrote

First of all... Thank you for your responses...

Secondly, yes, I understand that the DAL approach is one that Microsoft currently touts as best practice, but I guess, where I'm not clear, is whether I am doing something wrong, or if the DNN DAL, or any DAL for that matter is inherently slower.

Where did you see that Microsoft advises this as a best practice approach for DA?

gregfig wrote
   I guess the bottom line is, is the DAL really slower, or did it just unveil problems with my stored procedures and indexes that the old Database connection objects didn't really care about?  Perhaps the DAL is teaching me that I suck at writing stored procedures??? 

   I would like to know your thoughts...  In the meantime, I will stick with the DAL, after all, it is what Microsoft touts as the way to go (this year!).

Again, thanks for the responses!!



My opinions is... both

I belive your not optimized database does increase the slownes, but also that DNN DAL is a little bit slower that the normal ADO.NET approach. It is only normal that this is the case.... if you think architecturally, ADO.NET is straightforward, while DNN DAL gives you decoupling possibilities and thus takes some extra resources.

Now it all depends on what you need.... this is a normal architectural decision... do you go with maintainbility or speed? It depends what are you doing, and what are your requirements.

 


Thanks,
Vladan Strigo
NETMedia

My website: Vladan.Strigo.NET

Vladan.Strigo.NET: Projects
* Advanced VS2005 development approach - BlankModule
* DNN & Microsoft Ajax best practices guidance

Vladan.Strigo.NET: Resources
* Comprehensive list of DNN 4 Module development resources

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0To DAL or not To DALTo DAL or not To DAL


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out