Short answer -
Often the service layer proxies the gateway, but not always.
Also, there is no reason a archive layer couldn't communicate to multiple gateways and/or services.
Mark
Sent from my mobile doohickey.
--
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/-/TMMO_W0Au4gJ.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
I could argue that the DAO which gets data should return data in the appropriate format.
If the DAO doesn’t return data in the necessary format then what is the reason for it returning data in the wrong format.
Regards
Dale Fraser
--
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/-/Xx9BamB2AgQJ.
On 05/01/2012, at 6:45 AM, Dave wrote:
RE: DAO's. My approach is to define the DAO's responsibility as
"mapping single objects to DB records." The service layer / managers
should not know/care about how the objects get persisted/un-persisted
(queries via the CFQuery Tag). Your DAO "layer" consist classes (one
per object, eg, fooDAO) which contains methods like read(fooID), which
returns a object of type foo, and save(foo), which figures out if we
are doing an insert/update & persists the object.
The advantage of this approach is that when you feel comfortable with
using ORM, you can change your entire code base to ORM simply by
changing your DAO's & not having to change your entire service layer.
IE, under ORM, you still have a fooDAO.read(fooID) but instead of
these methods calling cfQuery tags, they change to be calls to
entityLoad("foo", arguments.fooID), the same applies to fooDAO.save(),
which would call entitySave(arguments.foo). Your service layer still
calls fooDAO.read(fooID), etc
I think that this ability, which is refereed to as "change an objects
internal implementation without changing it's external interface" is
one of the real benefits of OO programming & is probably one of the
skills/thought processes to learn first.
Think of your objects/classes as "black boxes" that operate on other
objects. If you calling code has no knowledge of how these black
boxes work, then it does not need to change when you decide to change
the inner workings of the black boxes. IE, you can change code in one
area without breaking other areas of your system.
Also, by having the service layer as well, I am now creating an awful lot of duplicate code.
I now must have;
serviceLayerCFC.getMyObject() AND
daoCFC.getMyObject()
--
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/-/RY-anMgSNdwJ.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
I just saw this on another group -
http://www.silverwareconsulting.com/index.cfm/2009/5/31/Building-An-Object-Oriented-Model--Recording-and-Sample-Code-Available
is a presentation that gives you a great overview of OO in cf.
--
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/-/upAXP3qmn78J.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
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/-/spBU7eoUpzQJ.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
> Technically this is not a duplicate of Code,
Yeah it's more 'boileplate' I guess?
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.
Technically this is not a duplicate of Code,
With the greatest of reservations about feeding the trolls....
What alternate universe do you live in, Andrew?
I clearly stated
The intent of the two CFCs is different.
and
that for "MY" work - the ServiceCFC was all but, always an empty stub for the method in the DAO CFC.
Given;
SericeCFC
1 <cffunction name="getStuff>
2 <cfargument name="name1">
3 <cfargument name="name2">
4 <cfargument name="name3">
5 <cfargument name="name4">
6 <cfargument name="name5">
7
8 <cfreturn DAO_CFC.getStuff(name1, name2, name3, name4, name5 >
9 </cffunction>
DAO_CFC
1 <cffunction name="getStuff>
2 <cfargument name="name1">
3 <cfargument name="name2">
4 <cfargument name="name3">
5 <cfargument name="name4">
6 <cfargument name="name5">
7
8 <cfquery name="myQuery">
9 SELECT * from #arguments,name1 where column1 = #arguments.name2" and column2 = #arguments.nam3# and column3=#arguments.name4# and column22 in (#arguments.name5#)
10 </cfquery>
11
12 <cfreturn myQuery >
13 </cffunction>
Under what circumstances, on planet earth, is lines 1 through 7, in either CFC not a duplicate of the other?
Whereby "duplicate" means;
(according to thefreedictionary.com)
1. Identically copied from an original.
I even stated in my post that I created the DAO CFC by copy / pasting the code from the Service CFC.
And included the caveat of;
So apart from the "guts" of the DAO method
And also provided the proof - that the application "diff" agreed with me.
But alas,
I forgot you know absolutely everything about everything and that you are never, ever, wrong.
Obviously, I am wrong. As must be every file “diffing” tool in existence.
Please accept my apology for not completely / wholly agreeing with you, instantly.
I am not sure what came over me,
I will never, ever doubt you or your stunning and dazzling ColdFusion brilliance, again.
In Andrew Scott We Trust - because he says so.
--
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/-/7z5ENOHbIvMJ.