DotNetNuke - Data Access Layer Alternative
Now that I’ve explained the standard way of creating a Data Access Layer (DAL) for DotNetNuke, we can address the alternative method of providing this same functionality.
You see, the only reason for creating the DataProvider abstract class and the SqlDataProvider implementation class is so that alternative data providers can be created. Originally, this was so that DotNetNuke could be supported on either MS-SQL or MS-Access databases. MS-Access is no longer supported by the DotNetNuke core, but there are still providers available for MySQL, Oracle, and probably a few others.
So if you are writing a module, or a set of modules, and they are intended to run on any DotNetNuke installation, you’ll want to follow the provider pattern I’ve laid out in the last several posts.
However, if you are writing a module that only needs to run under one installation, you can forget about the provider model. Use CodeSmith to create your stored procedures. But once you have those, you can use the standard DataSet and DataAdapters that are available to us in ASP.NET 2.0 or higher.
Of course, those of you who have been following along and have created a module using the provider module for a module that doesn’t need the provider model are thinking, “Now he tells me!”
So, in my defense, I will only say that I think it makes sense to learn how to do something “right” prior to “breaking the rules.” So if you are writing your first module in DNN, I would strongly recommend that you use the provider module just so you know how it is done and can gauge the level of complexity. My personal experience has been that most of the work in creating a module is above the DAL and that the extra work required to implement a provider model, once you are familiar with it, is trivial.
You’ll have to do it at least once so that you can make your own judgment call.
Other post in DotNetNuke - Module Development
- Creating DotNetNuke Modules - May 20th, 2008
- Creating DNN Modules - The Tools - May 22nd, 2008
- DotNetNuke Modules - Foundational Concepts - May 26th, 2008
- DotNetNuke Modules - Install DNN into VS 2008 - May 27th, 2008
- DotNetNuke Modules - Creating Base Modules - May 28th, 2008
- DotNetNuke Modules - Registering Your Module - May 29th, 2008
- DotNetNuke Modules - Where Stuff Shows Up - June 3rd, 2008
- DotNetNuke Modules - Benefits of Architecture - June 4th, 2008
- DotNetNuke Modules - Anatomy of the View - June 9th, 2008
- DotNetNuke Modules - Adding Actions - June 11th, 2008
- DotNetNuke Modules - DNN Controls - Label - June 18th, 2008
- DotNetNuke - Internationalization - June 25th, 2008
- DotNetNuke Modules - Internationalization (part 2) - June 30th, 2008
- DotNetNuke Modules - Labels w/ no Help - July 9th, 2008
- DotNetNuke Modules - LinkButtons - July 14th, 2008
- DotNetNuke Modules - Collapsible Panels - July 16th, 2008
- DotNetNuke - The Data Layer - Installing CodeSmith - July 22nd, 2008
- DotNetNuke - Modules - Creating The Tables - July 24th, 2008
- DotNetNuke - Modules - Creating Stored Procs - July 29th, 2008
- DotNetNuke - Modules - Portal Specific Modules - July 31st, 2008
- DotNetNuke Modules - Data Access Layer - August 5th, 2008
- DotNetNuke Modules - Data Access Layer - August 7th, 2008
- DotNetNuke - Data Access Layer Alternative - August 12th, 2008
- DotNetNuke - Modules - Linking within the module - August 14th, 2008
- DotNetNuke - Make Your Module Searchable - August 19th, 2008
- DotNetNuke Modules - Making Content Portable - August 25th, 2008
- DotNetNuke Modules - Exceptions the DNN Way - September 2nd, 2008
- DotNetNuke Modules - PortalModuleBase - September 4th, 2008
- DotNetNuke Modules - Inter Module Communication - September 9th, 2008
- DotNetNuke Modules - Finding The Page a Module is On - September 15th, 2008
- DotNetNuke Modules - Caching - September 17th, 2008
- DotNetNuke Modules - Module Settings - September 22nd, 2008
- DotNetNuke Modules - Retrieving Settings - September 24th, 2008
- DotNetNuke Modules - Advanced Architecture - October 20th, 2008
- DotNetNuke Modules - Creating the PA - October 30th, 2008
- DotNetNuke Modules - Automating the PA - November 5th, 2008
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

