So far we’ve done all of our development assuming that we are developing our module for internal use. To be fair, that’s what most of you all will be doing. There are a lot more of you who will be developing modules for internal use who will be fine with the architecture I’ve already given you, i.e., all of the files in one project.
But what about commercial projects?
One of the major requirements you will need to consider with a commercial project is: How do you allow other developers to supply a provider for other databases?
Yes, it is true that the great majority will be happy with the provider you’ve supplied. But since DotNetNuke allows other database systems to be used with it and since we are already coding our modules using the DotNetNuke provider architecture, why not make this available to others who want to use it?
The primary thing we need to do is to separate out the data provider pieces so they allow the user to swap the provider out with another one they’ve created. To do this we will create two new projects and move our existing code into those projects. Both of these projects will be Class Library projects.
The first project will be a DLL to hold our DataProvider interface. You’ll create this in the same solution by right clicking on the solution node in the solution explorer and selecting, “Add” > “New Project…”
Select “Class Library” from the project list and give it a unique name. I prefer to prefix the name the same as namespace and then name it “DataProvider”
You’ll then want to cut and paste the DataProvider.cs (or .vb) file from your app_code directory in the web project into the DataProvider project you just created.
You could stop here, but I find it makes a little more sense to also create a SQLProvider project similar to how you created the DataProvider project above and cut and paste the SqlDataProvider.cs (or .vb) file into that project.
You’ll need to have the web project and the SqlProvider project reference the DataProvider project so that they will both compile. You will also need to modify the output directory of the SqlProvider project so that it puts the final DLL into the bin directory of your DotNetNuke development application.
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 - 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 - 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
- Changing an Existing DNN Module - March 4th, 2010
- Facebook App using DotNetNuke - January 19th, 2012
- DotNetNuke Modules - Install DNN into VS 2008 - June 19th, 2012
- DotNetNuke SecurityException AspnetHostingPermission - February 19th, 2013
- DotNetNuke Modules - Benefits of Architecture - April 9th, 2013
- Debugging TypeScript Under DotNetNuke - May 8th, 2013
- DotNetNuke - FileUploadControl Danger! - September 18th, 2013
- DotNetNuke Modules - Anatomy of the View - October 23rd, 2013