"Technically"?

In the very initial post is this;

> But for the most part, my Service layer becomes a duplicate of the Gateway.
> * Ensure we have the required arguments for the gateway,
> * Call the gateway functions, using the supplied arguments
> * Return exactly the gateway's return value(s) to the consumer.
>

I suppose it is close to implementing an interface in terms of the code 
that is required to successfully run an application using a service layer.
If -  you're using the service layer at it's simplest - proxying the DAO / 
gateway.
And for the most part - that is 99.99% of what I have used a service layer 
for.

So, since the function Name is the same,
The arguments are named the same, 
The arguments are the same in number 
The arguments are the same in type...

In fact I (previously) wrote the DAO by;
Copy/pasting the the function from the serviceCFC
Add the required SQL
Alter as necessary the cfreturn code.

So apart from the "guts" of the DAO method - the service CFC version was / 
is a duplication of code found in the DAO version.

The intent  / the purpose of the two, is clearly different.... but it IS 
technically a duplication of code.
diff myServiceCFC, myDaoCFC even agrees with me.


Gavin

On Wednesday, January 11, 2012 3:52:18 PM UTC+11, Andrew Scott wrote:
>
> Technically this is not a duplicate of Code, 
>
> On Wed, Jan 11, 2012 at 3:15 PM, Gavin Baumanis <beaue...@gmail.com>wrote:
>
>> Sure thing.
>>  
>> gavinsManagerCFC
>> ...
>> <cffunction name="getgavinsObject">
>>     <cfargument name = "ag1" required="true"... >
>>     <cfargument name = "ag2 required="true"... >
>>  
>>     <cfreturn gavinsDAOCFC.getGavinsObject(arg1 = "#arguments.arg1#, arg2 
>> = "#arguments.arg2# >
>> </cffunction>
>>  
>>  
>> gavinsDAOCFC
>> ...
>>  <cffunction name="getgavinsObject">
>>     <cfargument name = "ag1" required="true"... >
>>     <cfargument name = "ag2 required="true"... >
>>  
>>     ... Some SQL
>>         WHERE column1 = "#arguments.arg1#"
>>        AND column2 = "#arguments.arg2#"
>>  
>>     return something (maybe)
>> </cffunction>
>>  
>> In this case the getGavinsObject in gavinsManagerCFC is "practically" a 
>> stub / duplication of the function in the DAO.
>> The argument is why bother?
>>  
>> Why not just call the DAO version of the CFC and do away with the 
>> managerCFC entirely?
>>  
>>  
>> Gavin.
>>
>>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/cfaussie/-/1FNtazDXDp4J.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to