DotNetNuke is a very flexible and scalable framework for the content management system built on the Microsoft .NET Framework. It is developed as a modular extendable structure so prebuilt modules, skin/themes, providers, and security methods can be installed to extend the functionalities of the DNN Web Application.
DNN Modules are extensions to the DotNetNuke platform. External or custom requirements/functionalities/processes that can be provided within ASP.NET can be adapted as Modules and added to the DNN Platform as DNN Custom Modules.
I’m explaining the list of points that need to take care of while developing or implementing the DotNetNuke Module or Extension.
1. Use the Correct Terminology/Naming Convention: Using consistent terminology in your DNN extensions helps make your code easy to understand for other developers and stakeholders and helps avoid confusion and makes it easier for others to understand and work with the code. It can have the word with installable or source package or at the code level like module, skin, control or provider, etc term. Naming convention improves the clarity and maintainability of the code and also helps easily understandable and maintainable code. It can be like HomeSearchNews, ListedArticleles, ListView, SettingsPanel, CachingProvider, DataStorageProvider, Corporate-Sub-Skin, COMPANY-Footer-Containers.
2. Maintain the Correct Folder Structure: Organize files into folders (components like Manifest file, Code-behind file, control ascx files, Class libraries, and style, Client Script or media resources file location, resource/language files) namespaces to avoid naming conflicts, use structured abstract classes to establish the connections and Caching Mechanism, well explained and documented code.
3. Use Customized DNN Module Templates/Project: VS allows project templates to be developed and prefixed as a template file like View, Edit, Setting files, Class library to export, upgrade, Database interaction, caching and accessing APIs with security, etc file declarations. A predefined project-wise DNN Module template can help to get uniformity among all extension modules getting designed and developed.
4. Providers and Stored Procedure: Using inbuilt DAL abstract classed layer is a global practice to deal with database connections and table structures which uses the Microsoft data block library recommended by Microsoft for communicating with a website to back, declaring every procedure at the database as stored procedure helps logic stored and gets better performance from the compiled queries. Memory leaks and unclosed connections can cause complex issues in long run, it should be avoided by using a predefined DNN Module standard approach to deal with data.
5. Utilizing DNN Settings, Edit, and Localization methodology: DNN Platform helps programs by providing a flexible framework where any developer can get the advantage of rapid development practice just by using inbuilt user controls like grid view, label, and table with inbuilt style sets, captcha or file upload control or allowing every module a settings section where admin can configure the variable settings for the extension. Multi-lingual modules can be designed where the same label or literal can have different content where the culture of the page is different. DNN Event logs and raising error with notifications easily when the developer follows the correct practice by utilizing inbuilt features of DNN Framework.
6. Clear, Optimized, and Commented/Documented Code: DNN Module code should be well structured, clear to understanding, and well compiled. Postback and Bindings should be handled correctly, and external client resources should have proper attachments with the control so they get cached and minified along with a full set of DNN style or script resources. There are predefined practices to bind and raised CURD operations with grid, list, form, or lookups it should be handled by a programmer to avoid any miss match with database schema and implemented code behind data operations.
7. DNN Module Standards with Coupling Framework
- IPortable: It’s an interface declared at the DotNetNuke Framework, it can help to export the content of the custom extension and can be imported to another instance of the DNN, resources like media files, etc can be excluded or exported as a zipped file.
- IActionable: Helps developer add actionable items to the drop-down menu at the edit or view module of the extension.
- IUpgradeable: It’s a set of processes declared by the programmer that gets executed when an extension or module gets upgraded, which means a higher version gets installed to enhance or upgrade the features of the module.
- ISearchable: It’s DNN Interface, a developer can declare the list of content needed to be conceded for the search feature when a user tries to use the DotNetNuke inbuilt search control with a specific keyword or content.
8. Security Majors: DNN Module allows consuming or offering Web Service, Rest API, or conventional approach to communicate with the server. It’s really important to handle the authentication mechanism while performing any data operation by a programmer like adding correct security authentication. XXS and DDos etc attach can be avoided by implementing the right form of a header, tokenized, cookie-based authentication while accessing or performing technical operations.
9. Responsory and Versioning: DotNetNuke Module needs to be maintained with upgradation and when it gets uninstalled all the resources along with database tables should be deleted to not impacted the nonusable resources on the performance issue of the portal. DNN Module code should be maintained at source control where multiple developers can work together with various versions and build with incremented versions to deploy the new features, enhancements, and bug fixes mentioned in the release note files.
10. Use Advance Tools: Configuring nuget and automated installable zip maker plays a vital role in the rapid and accurate development process. Generating SQL Script for the extension through an automated process with object qualifier and owner can help developers faster release and prepare the installable extension zip. GitHub or TFS generated version control file helps keep documented about changes getting incorporated with a track like where efforts getting spent and what result getting achieved.
We discussed best practices for developing DotNetNuke extensions. By following these best practices, you can ensure your extensions are high-quality, secure, and performant.
DotNetNuke Framework is very powerful and flexible enough to inject any custom functionality or your requirements, just a disciplined approach and utilizing framework features coupled with DNN accurately to perform a long time with less maintenance and performance.