tags:

views:

405

answers:

2

Are there any resources with information creating a self contained, reusable module?

I need to create modules that I can drop into projects quickly and easily. An example would be a news module that would contain an admin area, news listing page, supporting css+js, etc.

Am I smoking my socks or is this even possible?

+1  A: 

You need plugins for your application.

I've got a plugin library (in development and in Spanish) that you might use as an example or a starting point. I don't know how good google translate will be but you can check a C# plugin tutorial in http://translate.google.com/translate?hl=es&ie=UTF-8&u=http://www.thealphasite.org/es/sistema_de_plugins_con_c_y_net&sl=es&tl=en

A plugin allows you to plug in :P functionality into your application and, with a proper design, it will allow you to move functionality dinamically from one application to another.

Anyway, plugin just provide with ease of use but require a design specifically thought with them in mind. On the other hand, basic "take this module and use it in another project" is just proper encapsulation and good design. If a module is well designed the it should be able to be ported to another site or application with very little effort.

Keep in mind that, specifically for web, "theming" is a complex subject, that is, adapting your plugin to the way an specific web looks is another step of customization which has to be included into the module itself. You can see an example in the Drupal theming functions and the theming api documentation.

Jorge Córdoba
A: 

Not sure about any resources - but I've done this myself by writing a CMS from scratch using a combination of user controls for the modules, and a templating system with common code file which loads said user controls into placeholders.

The templating system allows you to create an aspx file, with a bunch of placeholders (as many as you need) - then you need a database or similar to manage what controls go to what placeholders, on what page. A template can handle many pages.

Downloading and studying the architecture for dotnetnuke can enlighten and give ideas for structuring your own approach, even though it's VB, the data structure is just as interesting.

billfredtom