Two versions of an application using modules

21 views
Skip to first unread message

Gary Smith

unread,
Apr 4, 2017, 2:15:07 PM4/4/17
to ColdBox Platform
We have an application that has been split into two different versions and is hosted on two separate servers with two separate databases. The code between the two is 60% the same. It's a booger to have to maintain all that similar code in two places and I'd rather have one set of common code with modules to add on the differences between the two systems.

We currently have two separate Git repositories, one for each version of the application.

I'm trying to think through the process of combining the shared code into one repository and where to maintain the modules for version A and version B code. I'm guessing they would all have to be in the same Git repository? Or at least exist as working code on the same server so they can be pulled in as modules into the main set of code?

I haven't worked with Coldbox Modules yet so I don't have a frame of reference for this or know where to start. Please make your suggestions and responses with this in mind. I know basic Coldbox, but not modules.

br...@bradwood.com

unread,
Apr 4, 2017, 3:27:30 PM4/4/17
to col...@googlegroups.com
It's worth noting that ColdBox has "external" locations for handlers, models, layouts, and views which can allow for a "common" folder of code that's shared.  However, modules are probably a a much better starting point since they let you abstract out entire functional chunks of your site.  I would start by no longer thinking of your codebase as one giant ball.  Build a module map diagram of all the high level pieces of your site including what's shared and what's different per app.  Then move toward actually breaking those chunks of code out into separate repos.  You can use CommandBox and your box.json to create a "recipe" for what modules are needed to build a given app. Modules don't have to be hosted on ForgeBox (though we are making plans for ForgeBox private packages).  You can host your own private artifacts repo, or just point your dependencies straight at your private Git repos and CommandBox can install what you need from there.  This will even allow you to have each site run on a different version of a module as well which opens the door to rolling out features in a shared module to one app at a time.  And don't worry if one module has a hard dependency on another.  That's not a bad thing.
 
Anyway. there's my brain dump, but mostly boils down to:
1) Plan your modules out
2) Separate the code 
3) Use a CommandBox-based build process to assemble your app with the pieces you need.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/38f1ad4a-0a8f-4ec2-8f87-703fd44da70e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gary Smith

unread,
Apr 4, 2017, 4:48:35 PM4/4/17
to ColdBox Platform
Thanks Brad, this is the high level starting point I was after. I'll take it to the team and see how far we get. Maybe we'll have more questions when we get further.
Reply all
Reply to author
Forward
0 new messages