The Blackbox Method for CF and PHP
login  
Current Path:   blackboxsystem.sourceforge.net/method.php
    Information about the
    BlackBox Method
 > welcome
 > the method
 > CF blackbox file
 > PHP blackbox file
 > faq
    Contact Info
 > contact
 > join


About the Blackbox Method


Blackbox As A Concept
In ColdFusion, custom tags allow developers to encapsulate functionality into an abstract, reusable piece of code. Similarly, PHP calls defined functions. For simple things this is a fine approach, but when it comes to creating modular, multi-faceted reusable web modules it gets a little tricky. Enter Blackbox.

The underlying principles behind Blackbox are that developers want to be able to access certain aspects of functionality from anywhere within their web application and they want to be able to customize the appearance of a given functionality on a per-implementation basis. Blackbox developers create modules that contain actions that all relate to a specific aspect of a site's functionality.

A link module might contain actions for:
  • displaying a list of link categories
  • displaying a list of links within a category
  • logging which links were clicked and redirecting the user to the linked page
  • creating a form that will allow users to submit links
  • handling the form submission from the previous action and adding the link to the database
Each action performs a single task, simplifying the coding of each piece. Each action accepts attributes that can also have default values. This allows for a high level of flexibility in creating the output from your action. You can even call other Blackbox modules and/or actions from within another.

The Blackbox File: Two Options
A Blackbox module and action is called by accessing the Blackbox custom tag in CF (cf_blackbox) or a function in PHP (php_blackbox). The format of this tag can take two forms: these two forms accomplish the same end, they are simply two ways of stating the same thing. In both cases they refer to a module called "themodule" and a file called "theaction.cfm" or "theaction.php" that is a part of that module. These tags can accept any additional arguments that you want to pass in. Coming soon, we will present a technique that will allow you to have default behaviors for aspects of each option while giving you the flexibility to expand their functionality as needed.



Blackbox Method at Sourceforge:   Visit http://sourceforge.net/projects/blackboxsystem/
Time to generate page = 0.234775 seconds