Need help understanding what an OOP Gateway is
Slowly and surely I am learning OOP with CF, but I'm stuck at the concept of gateways. In my custom framework, when I want data, I simply do the following:
<cfset myData = APPLICATION.coms.data.executeQuery(
sql = 'get-open-tickets',
data = {
'firstName' = 'Aegis',
'lastName' = 'Kleais'
}
) />
Basically it calls a singleton 'data' component I have stored in APPLICATION.coms and runs an executeQuery method. This takes 2 arguments, sql (the name of the SQL file to load from a repository that contains all the SQL) and data (A structure that allows the sql file in question to reference dynamic data; in the above, the SQL being executed has access to ARGUMENTS.data.firstName and ARGUMENTS.data.lastName.
The query is executed, SQL run, data returned, and I'm done.
But from what I've gathered about gateways, I'm supposed to create an object, make a method called getOpenTickets and then pass in data instead. Since this has to do with tickets, I assume naming conventions would dicated I create ticketGateway.cfc and then build a 'getOpenTickets" function inside of that.
Am I understanding this correctly?
