1 / 19

BlackBox Methodology

BlackBox Methodology. A means of creating efficient and flexible reusable ColdFusion code. www.cfblackbox.com. Personal Info -Dan Chick. Web programmer since 1994 Founder of FastCart Corp. ( www.fastcart.com ) Founder of Webkit Inc. ( www.webkit.com ) Creator of BlackBox Methodology

malindah
Download Presentation

BlackBox Methodology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BlackBox Methodology A means of creating efficient and flexible reusable ColdFusion code. www.cfblackbox.com

  2. Personal Info -Dan Chick • Web programmer since 1994 • Founder of FastCart Corp. (www.fastcart.com) • Founder of Webkit Inc. (www.webkit.com) • Creator of BlackBox Methodology • Published CF author, Allaire.com, CFDJ • Ran Twin Cities CFUG for 3 years • Semi-pro photographer and musician • dan@webkit.com

  3. The State of 1999 • Fusebox (www.fusebox.org) • Difficult to nest modules/applications • Unattractive URLs • Often difficult to customize the output • I created techniques to address these but they were awkward and difficult • I wanted a better way that addressed all of these issues. Enter BlackBox….

  4. What’s in a Good Methodology? • Separates brains from beauty • Re-use of code • Flexible code • Attractive URLs • Ability to make different modules interact • Lets you code in your own style while still allowing you to share code with others • Simple to learn and employ

  5. Why BlackBox? Developers say… • Abstraction of functionality • A high level of code re-use • A tremendous increase in development speed • Enhanced flexibility and extensibility • A thought process leading to an ease of development • Rapid prototypes • Compartmentalization of code • Easy knowledge transfer • Portability and openness • Confidence in existing modules

  6. Coding in BlackBox • Learn the concept • Get blackbox.cfm • (Optional) Get starter modules from cfblackbox.com • Start coding

  7. Technical Aspects • It’s all about how your organize your files Web Root (folder, can access modules) Blackbox (folder) Forums Guestbook Users Blackbox.cfm Directory1 (folder, can access modules) Blackbox.cfm Directory2 (folder , can access modules) Blackbox.cfm Directory3 (folder , can NOT access modules)

  8. Or… Custom Tag Folder Custom Tags Blackbox (folder) Forums Guestbook Users Blackbox.cfm Web Root (folder, can access modules) Directory1 (folder, can access modules) Directory2 (folder , can access modules) Directory3 (folder , can access modules)

  9. How To Call Blackbox <CF_BLACKBOX TOOL=“users.login_form”> <CF_BLACKBOX TOOL=“users.login_action”> OR <CF_BLACKBOX TOOL=“users.login_package”> (more on packages in a second…)

  10. Interview with the Module • bbsettings.cfm • Form_add_message.cfm • Display_messages.cfm • Action_add_message.cfm These can be coded in ANY STYLE YOU WANT!!!

  11. Techniques:bbsettings.cfm • I put a file called bbsettings.cfm in the Blackbox root folder • Contains functions and settings I want to share to all modules • Another file in each module called bbsettings.cfm that includes ../bbsettings.cfm • My blackbox.cfm file checks to see if this file exists in module folder and includes it. • Think of this as a sort of an application.cfm for one or more modules

  12. Techniques: application.cfm • Certain variables can be shared if they are established in the scope of the entire app • Request.datasource, request.username, request.password • Application.site_root, application.site_directory

  13. Inheriting settings……if you want <CFPARAM NAME="request.datasource" DEFAULT=""> <CFPARAM NAME="attributes.datasource" DEFAULT="#request.datasource#"> #attributes.datasource# - uses passed value OR request value as default OR is empty <CFPARAM NAME=“session.user_guid" DEFAULT=""> <CFPARAM NAME=“form.user_guid " DEFAULT="#session.user_guid #"> <CFPARAM NAME=“url.user_guid " DEFAULT="#form.user_guid #"> <CFPARAM NAME=“attributes.user_guid " DEFAULT="#url.user_guid #"> #attributes.user_guid# - uses passed value OR url value OR form value OR session value OR is empty

  14. Packages - Overview • All pages link to attributes.nextpage • attributes.nextpage default value is cgi.script_name • Each page exit action (link, form) passes another variable (module_action) • One ‘package’ action within the folder is the only action called. It uses module_action to access the right files • Modules can be called as packages OR as standalone actions

  15. Packages - Anatomy <CFPARAM NAME="form.links_action" DEFAULT="categories"> <CFPARAM NAME="url.links_action" DEFAULT="#form.links_action#"> <CFPARAM NAME="attributes.links_action" DEFAULT="#url.links_action#"> <CFSWITCH EXPRESSION="#attributes.links_action#"> <CFCASE VALUE="categories"> <CFINCLUDE TEMPLATE="categories.cfm"> </CFCASE> <CFCASE VALUE="category_detail"> <CFINCLUDE TEMPLATE="category_detail.cfm"> </CFCASE> <CFCASE VALUE="click_link"> <CFINCLUDE TEMPLATE="click_link.cfm"> </CFCASE> </CFSWITCH>

  16. Illustration of Time Saved • ColderFusion 50 minutes including design • User and user profiles • Content • Links • File Repository • Forums

  17. The developing community • www.cfblackbox.com • Forums • File sharing area • White papers • Developer Profiles • Mailing List • http://groups.yahoo.com/group/cfblackbox/

  18. Some sites running BlackBox • www.flashmn.com • www.darktwincities.com • www.colderfusion.com • www.cfblackbox.com • www.pinhole.org • www.photosmack.com

  19. Questions…..

More Related