SlideShare a Scribd company logo
Thinking
Modularly
Modern CFML
Brad Wood
@bdw429s
What is a package?
Reusable, self contained, self describing, versioned code, functionality, or
application building blocks.
● A folder
● A box.json file
● Some code
A package could be a single UDF or an entire CMS. What makes it portable is the
agreed format of packaging, distribution, and installation.
What is a module?
A Box module is everything a package is, but with additional conventions and
lifecycle methods defined by ColdBox, ContentBox, CommandBox, etc.
● A folder
● A box.json file
● A ModuleConfig.cfc
● Some code
A Module could be a single interceptor or an entire shopping cart. Box modules are
“active” the framework loads them and they can run custom logic on registration as
well as contribute behaviors or functionality to the base app.
● Forgebox
○ https://www.forgebox.io
● HTTP(S)
○ http://mysite.com/myPackage.zip
● Git
○ git@github.com:bdw429s/commandbox-fusionreactor.git
● GitHub
○ bdw429s/commandbox-fusionreactor
● Local file/folder
○ C:/folder/myPackage.zip
● Jars
○ https://search.maven.org/remotecontent?filepath=org/jline/jline/3.7.0/jline-3.7.0.jar
Installing Packages
● ColdBox modules
○ cborm, cbvalidation, cbmessagebox
● CommandBox modules
○ Fusion-reactor, bullet train, host updater
● Non-box frameworks/CMSs
○ Preside, FW/1, CFWheels
● Total standalone stuff
○ SecurityUtil, BrewPunk API
ForgeBox.io
● Packages can depend on other packages
● Promotes reusability and smaller, single-purpose packages
● cborm
○ cbvalidation
■ Cb18n
● Dev dependencies
○ Only required for developing on the project (like testing frameworks)
○ Don’t want installed on production
○ Use “install --production” to skip
Package Dependencies
CFConfig Example
● Commandbox-cfconfig
○ cfconfig-services
■ lucee-password-util
■ JSONPrettyPrint
■ Adobe-password-util
● propertyFile
■ semver
■ propertyFile
Turn any folder into a package with one CLI command:
package init
Want some hand holding?
package init --wizard
Set additional metadata with:
package set name=”My Package”
Let’s create a package
Scaffold out a new module with one CLI command:
coldbox create module myModule
Let’s take a look at the ModuleConfig.cfc
component {
function configure() {
}
}
Let’s create a module
modules/
These are modules managed by CommandBox. Usually 3rd party. Not committed to
source control.
modules_app/
These are modules that are a core part of your app that you want to be part of the
main source repo. CommandBox doesn’t not manage them.
Box Module Locations
A ForgeBox account is free, easy, and let’s you publish packages and collaborators
forgebox register
Already have a ForgeBox account?
forgebox login
Create a ForgeBox account
● What happens when your code changes?
● You need to increment the version!
● Semantic versioning
○ Major
○ Minor
○ Patch
○ Prerelease Identifier
○ Build ID
Versioning
❏ 5
❏ 3.2
❏ 1.7.8
❏ 1.2.3-alpha
❏ 5.6+0045
❏ 2-beta.3
❏ 1.2.3-rc.4+9876
Semver Ranges
● Give me the latest version that starts with 5
○ 5.x
● Any version greater than 1.0.0 starting with 1.0.1
○ >1.0.0
● Any version between 2.0.0 and 2.5.0 inclusive
○ >=2.0.0 <=2.5.0
○ 2.0.0 - 2.5.0
● Any one of these exact versions
○ 1.0.0 || 2.0.0 || 3.0.0
● Allows 1.2.4 and 1.3, but not 2.0 (same as 1.x.x)
○ ^1.2.3
From the CLI
install coldbox@4.3
install testbox@<=2.6
In your box.json
“dependencies” : {
“coldbox” : “4.3”,
“Testbox” : “<=2.6”
}
Install a Specific Version
Automatically increment version numbers in box.json
● bump --major
● bump --minor
● bump --patch
If package is a Git repo, a tag will be created that matches the version number.
This helps “lock in” the exact commit of this version.
Bump Command
● Arbitrary commands of your choice to run at interception points
● postVersion
● onRelease
● postPublish
● Ties multiple steps together
● Automates repetitive bits
● Boils releasing down to a single command
"scripts" : {
"postVersion":"package set location='Ortus-Solutions/commandbox-cfconfig#v`package version`'",
"onRelease":"publish",
"postPublish":"!git push --follow-tags",
}
Package Scripts
A nice tool for scaffolding box modules complete with tests, Travis-CI builds, and
package scripts.
module scaffold myCoolModule
https://www.forgebox.io/view/cb-module-template
cbModuleTemplate Module
● Your code
● Frameworks
● 3rd party modules
● Your modules
● Git ignores
● box.json
● “Install” command
● --production flag
Building Your Apps

More Related Content

PDF
MySQL Compatible Open Source Connectors
ODP
#1 Backend Meetup - Symfony 2 - wstęp
PPTX
Advantages and disadvantages of a monorepo
PPTX
Master the Monorepo
PPTX
Edius and K2 Connect in FTP mode
ODP
Comparison between OpenERP v6.1 and v7
PDF
Do you speak vcl
PDF
Do you speak VCL?
MySQL Compatible Open Source Connectors
#1 Backend Meetup - Symfony 2 - wstęp
Advantages and disadvantages of a monorepo
Master the Monorepo
Edius and K2 Connect in FTP mode
Comparison between OpenERP v6.1 and v7
Do you speak vcl
Do you speak VCL?

Similar to Itb2018 thinking modularly (20)

PDF
Intro To CommandBox CLI,Package Manager, Server at the Japan CFUG
PDF
CommandBox & ForgeBox Package Management
PDF
ITB2016 - ForgeBox 2 Package Management
PDF
Command Box ColdFusion Package Manager, Automation
ODP
CommandBox REPL, CLI, and Package Manager
PPTX
Command box, Package Manager, Automation, REPL
PDF
CommandBox at CFCamp 2014
PDF
CommandBox : Free CFML
PDF
PDF
Command box
PDF
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
PDF
Into The Box 2018 Ortus Keynote
PPTX
ITB2015 - Go Commando with CommandBox CLI
PDF
ITB2017 - Keynote
PDF
ITB2019 ForgeBox Enterprise : Private Software Directory - Javier Quintero
PDF
Cold box hierarchical mvc
PDF
ITB2019 Scaling with CommandBox in Production! - Brad Wood
PDF
Itb2018 cf apps to dev to production with command box cf-config docker
PDF
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
PDF
Brad Wood 5 command box modules you should be using
Intro To CommandBox CLI,Package Manager, Server at the Japan CFUG
CommandBox & ForgeBox Package Management
ITB2016 - ForgeBox 2 Package Management
Command Box ColdFusion Package Manager, Automation
CommandBox REPL, CLI, and Package Manager
Command box, Package Manager, Automation, REPL
CommandBox at CFCamp 2014
CommandBox : Free CFML
Command box
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
Into The Box 2018 Ortus Keynote
ITB2015 - Go Commando with CommandBox CLI
ITB2017 - Keynote
ITB2019 ForgeBox Enterprise : Private Software Directory - Javier Quintero
Cold box hierarchical mvc
ITB2019 Scaling with CommandBox in Production! - Brad Wood
Itb2018 cf apps to dev to production with command box cf-config docker
Brad wood - 5 CommandBox Modules You Should Be Using [Into The Box 2020]
Brad Wood 5 command box modules you should be using
Ad

More from Ortus Solutions, Corp (20)

PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
PDF
June Webinar: BoxLang-Dynamic-AWS-Lambda
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
PDF
What's-New-with-BoxLang-Brad Wood.pptx.pdf
PDF
Getting Started with BoxLang - CFCamp 2025.pdf
PDF
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
PDF
What's New with BoxLang Led by Brad Wood.pdf
PDF
Vector Databases and the BoxLangCFML Developer.pdf
PDF
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
PDF
Use JSON to Slash Your Database Performance.pdf
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
PDF
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
PDF
Supercharging CommandBox with Let's Encrypt.pdf
PDF
Spice up your site with cool animations using GSAP..pdf
PDF
Passkeys and cbSecurity Led by Eric Peterson.pdf
PDF
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
PDF
Integrating the OpenAI API in Your Coldfusion Apps.pdf
PDF
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
PDF
Geting-started with BoxLang Led By Raymon Camden.pdf
PDF
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
June Webinar: BoxLang-Dynamic-AWS-Lambda
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Getting Started with BoxLang - CFCamp 2025.pdf
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
What's New with BoxLang Led by Brad Wood.pdf
Vector Databases and the BoxLangCFML Developer.pdf
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Use JSON to Slash Your Database Performance.pdf
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Supercharging CommandBox with Let's Encrypt.pdf
Spice up your site with cool animations using GSAP..pdf
Passkeys and cbSecurity Led by Eric Peterson.pdf
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Geting-started with BoxLang Led By Raymon Camden.pdf
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
1. Introduction to Computer Programming.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Assigned Numbers - 2025 - Bluetooth® Document
1. Introduction to Computer Programming.pptx
A Presentation on Artificial Intelligence
Mobile App Security Testing_ A Comprehensive Guide.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TLE Review Electricity (Electricity).pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Group 1 Presentation -Planning and Decision Making .pptx
A comparative analysis of optical character recognition models for extracting...
cloud_computing_Infrastucture_as_cloud_p
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Itb2018 thinking modularly

  • 2. What is a package? Reusable, self contained, self describing, versioned code, functionality, or application building blocks. ● A folder ● A box.json file ● Some code A package could be a single UDF or an entire CMS. What makes it portable is the agreed format of packaging, distribution, and installation.
  • 3. What is a module? A Box module is everything a package is, but with additional conventions and lifecycle methods defined by ColdBox, ContentBox, CommandBox, etc. ● A folder ● A box.json file ● A ModuleConfig.cfc ● Some code A Module could be a single interceptor or an entire shopping cart. Box modules are “active” the framework loads them and they can run custom logic on registration as well as contribute behaviors or functionality to the base app.
  • 4. ● Forgebox ○ https://www.forgebox.io ● HTTP(S) ○ http://mysite.com/myPackage.zip ● Git ○ git@github.com:bdw429s/commandbox-fusionreactor.git ● GitHub ○ bdw429s/commandbox-fusionreactor ● Local file/folder ○ C:/folder/myPackage.zip ● Jars ○ https://search.maven.org/remotecontent?filepath=org/jline/jline/3.7.0/jline-3.7.0.jar Installing Packages
  • 5. ● ColdBox modules ○ cborm, cbvalidation, cbmessagebox ● CommandBox modules ○ Fusion-reactor, bullet train, host updater ● Non-box frameworks/CMSs ○ Preside, FW/1, CFWheels ● Total standalone stuff ○ SecurityUtil, BrewPunk API ForgeBox.io
  • 6. ● Packages can depend on other packages ● Promotes reusability and smaller, single-purpose packages ● cborm ○ cbvalidation ■ Cb18n ● Dev dependencies ○ Only required for developing on the project (like testing frameworks) ○ Don’t want installed on production ○ Use “install --production” to skip Package Dependencies
  • 7. CFConfig Example ● Commandbox-cfconfig ○ cfconfig-services ■ lucee-password-util ■ JSONPrettyPrint ■ Adobe-password-util ● propertyFile ■ semver ■ propertyFile
  • 8. Turn any folder into a package with one CLI command: package init Want some hand holding? package init --wizard Set additional metadata with: package set name=”My Package” Let’s create a package
  • 9. Scaffold out a new module with one CLI command: coldbox create module myModule Let’s take a look at the ModuleConfig.cfc component { function configure() { } } Let’s create a module
  • 10. modules/ These are modules managed by CommandBox. Usually 3rd party. Not committed to source control. modules_app/ These are modules that are a core part of your app that you want to be part of the main source repo. CommandBox doesn’t not manage them. Box Module Locations
  • 11. A ForgeBox account is free, easy, and let’s you publish packages and collaborators forgebox register Already have a ForgeBox account? forgebox login Create a ForgeBox account
  • 12. ● What happens when your code changes? ● You need to increment the version! ● Semantic versioning ○ Major ○ Minor ○ Patch ○ Prerelease Identifier ○ Build ID Versioning ❏ 5 ❏ 3.2 ❏ 1.7.8 ❏ 1.2.3-alpha ❏ 5.6+0045 ❏ 2-beta.3 ❏ 1.2.3-rc.4+9876
  • 13. Semver Ranges ● Give me the latest version that starts with 5 ○ 5.x ● Any version greater than 1.0.0 starting with 1.0.1 ○ >1.0.0 ● Any version between 2.0.0 and 2.5.0 inclusive ○ >=2.0.0 <=2.5.0 ○ 2.0.0 - 2.5.0 ● Any one of these exact versions ○ 1.0.0 || 2.0.0 || 3.0.0 ● Allows 1.2.4 and 1.3, but not 2.0 (same as 1.x.x) ○ ^1.2.3
  • 14. From the CLI install coldbox@4.3 install testbox@<=2.6 In your box.json “dependencies” : { “coldbox” : “4.3”, “Testbox” : “<=2.6” } Install a Specific Version
  • 15. Automatically increment version numbers in box.json ● bump --major ● bump --minor ● bump --patch If package is a Git repo, a tag will be created that matches the version number. This helps “lock in” the exact commit of this version. Bump Command
  • 16. ● Arbitrary commands of your choice to run at interception points ● postVersion ● onRelease ● postPublish ● Ties multiple steps together ● Automates repetitive bits ● Boils releasing down to a single command "scripts" : { "postVersion":"package set location='Ortus-Solutions/commandbox-cfconfig#v`package version`'", "onRelease":"publish", "postPublish":"!git push --follow-tags", } Package Scripts
  • 17. A nice tool for scaffolding box modules complete with tests, Travis-CI builds, and package scripts. module scaffold myCoolModule https://www.forgebox.io/view/cb-module-template cbModuleTemplate Module
  • 18. ● Your code ● Frameworks ● 3rd party modules ● Your modules ● Git ignores ● box.json ● “Install” command ● --production flag Building Your Apps