Created
August 28, 2015 03:58
-
-
Save wellercs/b2edc1920973874574b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// inside Application.cfc is service constructor | |
application.EnterpriseService = new path.to.EnterpriseService(); | |
// inside site code somewhere | |
application.EnterpriseService.call(api_id=#, custom_args={}); | |
// EnterpriseService.cfc | |
init() { | |
// some shared constants set here | |
// dependent objects needed by multiple services initialized here | |
} | |
// this method is single entry/exit point | |
call() { | |
// object to init and method to call are dynamically determined | |
variables.SomeOtherService = new path.to.SomeOtherService(); | |
variables.SomeOtherService.someMethod(); | |
} | |
// SomeOtherService.cfc | |
// SomeOtherDAO.cfc | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment