[cfaussie] OO Application Architecture

2012-01-03 Thread Gavin Baumanis
Hi Everyone,
 
I was recently chatting at work about how we might go about architecting a 
new application.
I suggested that we have;
Objects,
Service Managers
and Gateways.
 
Whereby the ServiceManager is the public API for the gateway.
 
Then I got asked , Why?
 
I explained that it was good practice to separate out the plublic API from 
the gateway and gave the example of changing database providers.
Eg. Swapping from MS-SQL server to PostGreSQL.
 
With my architecture proposal, you only need to change the gateway (perhaps 
some minor tweaks to the ServiceManager CFCs.
 
So far so goo... Until I got asked Why again.
You still need to change the code somewhere for the new database flavour.
What is the ServiceManager  doing for us, it seems like a redundant 
duplication of code?
 
Subsequently, I have been thinking about it more - and can't come up with a 
good reason.
 
I could be doing it completely wrong...
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.
 
99.9% of the time the arguments are exactly the same,
The data / structure (whatever) that is returned from the gateway, is 
returned unaltered to the consumer, too.
For the very small number of times that I might do some data transformation 
(in the ServiceManager) before it is returned... well I could simply create 
THAT method in my gateway and have;
* Call the this.GETTER method
* Transform the data as required
* Return the transformed data
 
So am I missing something? Or have I just talked myself out of the 
requirement for (perhaps, excluding web-services) of ever needing to have a 
separate service layer to a Gateway CFC?
 
 
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/-/TMMO_W0Au4gJ.
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.



Re: [cfaussie] OO Application Architecture

2012-01-03 Thread Mark Mandel
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.
On Jan 4, 2012 11:46 AM, Gavin Baumanis beauecli...@gmail.com wrote:

 Hi Everyone,

 I was recently chatting at work about how we might go about architecting a
 new application.
 I suggested that we have;
 Objects,
 Service Managers
 and Gateways.

 Whereby the ServiceManager is the public API for the gateway.

 Then I got asked , Why?

 I explained that it was good practice to separate out the plublic API from
 the gateway and gave the example of changing database providers.
 Eg. Swapping from MS-SQL server to PostGreSQL.

 With my architecture proposal, you only need to change the gateway
 (perhaps some minor tweaks to the ServiceManager CFCs.

 So far so goo... Until I got asked Why again.
 You still need to change the code somewhere for the new database flavour.
 What is the ServiceManager  doing for us, it seems like a redundant
 duplication of code?

 Subsequently, I have been thinking about it more - and can't come up with
 a good reason.

 I could be doing it completely wrong...
 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.

 99.9% of the time the arguments are exactly the same,
 The data / structure (whatever) that is returned from the gateway, is
 returned unaltered to the consumer, too.
 For the very small number of times that I might do some data
 transformation (in the ServiceManager) before it is returned... well I
 could simply create THAT method in my gateway and have;
 * Call the this.GETTER method
 * Transform the data as required
 * Return the transformed data

 So am I missing something? Or have I just talked myself out of the
 requirement for (perhaps, excluding web-services) of ever needing to have a
 separate service layer to a Gateway CFC?


 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/-/TMMO_W0Au4gJ.
 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.


-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.



[cfaussie] Re: OO Application Architecture

2012-01-03 Thread Dave
I explained that it was good practice to separate out the plublic API
from
the gateway and gave the example of changing database providers. 

Not sure that's a great argument - changing DB's is very rare in
projects.

Question:  Does your app consist of just database calls, or is there
ever any business logic type stuff going on too?

IMHO, a greater reason to isolate queries to their own gateway layer
is that queries tend to be large, ugly things that makes business
logic header to read.  IE, if your service layer consists of both
business logic and queries, it's harder to see the business logic.

Having only methods in the gateway that return queries (instead of
structs) also encourages code re-use, ie, method a might want the
data as a query for easy display, method b might want the data as
struct because it's gotta add form data to is to work out how/what to
save or what's changed.

The duplication isn't too hard to deal with either. Write your wrapper
cfFunction in the service layer, copy/paste it to the gateway layer
and replace the contents with a cfquery tag.  Probably adds a minute
or two per method.


dave





On Jan 4, 11:46 am, Gavin Baumanis beauecli...@gmail.com wrote:
 Hi Everyone,

 I was recently chatting at work about how we might go about architecting a
 new application.
 I suggested that we have;
 Objects,
 Service Managers
 and Gateways.

 Whereby the ServiceManager is the public API for the gateway.

 Then I got asked , Why?

 I explained that it was good practice to separate out the plublic API from
 the gateway and gave the example of changing database providers.
 Eg. Swapping from MS-SQL server to PostGreSQL.

 With my architecture proposal, you only need to change the gateway (perhaps
 some minor tweaks to the ServiceManager CFCs.

 So far so goo... Until I got asked Why again.
 You still need to change the code somewhere for the new database flavour.
 What is the ServiceManager  doing for us, it seems like a redundant
 duplication of code?

 Subsequently, I have been thinking about it more - and can't come up with a
 good reason.

 I could be doing it completely wrong...
 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.

 99.9% of the time the arguments are exactly the same,
 The data / structure (whatever) that is returned from the gateway, is
 returned unaltered to the consumer, too.
 For the very small number of times that I might do some data transformation
 (in the ServiceManager) before it is returned... well I could simply create
 THAT method in my gateway and have;
 * Call the this.GETTER method
 * Transform the data as required
 * Return the transformed data

 So am I missing something? Or have I just talked myself out of the
 requirement for (perhaps, excluding web-services) of ever needing to have a
 separate service layer to a Gateway CFC?

 Gavin.

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.



[cfaussie] CF Report Builder tool: any success stories?

2012-01-03 Thread Barry Beattie
I was just going through the cfaussie archives for anything on Report
Builder.

not many posts (2 for 2011)

either: it's so simple to use, it gets results without headache
or: not many people are using it.

Have people been able to successfully incorporate Report Builder into apps
for end users to generate reports (and save CFR files to re-run at a later
date)?

thanks
Barry Beattie

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.



RE: [cfaussie] CF Report Builder tool: any success stories?

2012-01-03 Thread Dale Fraser
We use it widely here,

 

It's actually a very good tool with limitations, but free.

 

Its integrated into our app and produces PDF reports.

 

The main advantage it has over cfdocument is pixel level control and
pagination.

 

Be happy to answer any questions you might have Barry, I believe I'm the
only user J

 

Regards

Dale Fraser

 

 http://dale.fraser.id.au http://dale.fraser.id.au

 http://cfmldocs.com http://cfmldocs.com

 http://learncf.com http://learncf.com

 http://flexcf.com http://flexcf.com

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of Barry Beattie
Sent: Wednesday, 4 January 2012 1:41 PM
To: cfaussie
Subject: [cfaussie] CF Report Builder tool: any success stories?

 

I was just going through the cfaussie archives for anything on Report
Builder.

 

not many posts (2 for 2011)

 

either: it's so simple to use, it gets results without headache

or: not many people are using it.

 

Have people been able to successfully incorporate Report Builder into apps
for end users to generate reports (and save CFR files to re-run at a later
date)?

 

thanks

Barry Beattie

-- 
You received this message because you are subscribed to the Google Groups
cfaussie group.
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.

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.



Re: [cfaussie] CF Report Builder tool: any success stories?

2012-01-03 Thread Barry Beattie
thanks Dale, appreciated.

any nasty limitations? (apart from the builder tool being on Windows only)

Do your end-users produce/manage the created CFR files? (a requirement is
for shared and per-user/individual custom reports)

thanks
B

On Wed, Jan 4, 2012 at 12:50 PM, Dale Fraser d...@fraser.id.au wrote:

 We use it widely here,

 ** **

 It’s actually a very good tool with limitations, but free.

 ** **

 Its integrated into our app and produces PDF reports.

 ** **

 The main advantage it has over cfdocument is pixel level control and
 pagination.

 ** **

 Be happy to answer any questions you might have Barry, I believe I’m the
 only user J

 ** **

 Regards

 Dale Fraser

 ** **

 http://dale.fraser.id.au

 http://cfmldocs.com

 http://learncf.com

 http://flexcf.com

 ** **

 *From:* cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] *On
 Behalf Of *Barry Beattie
 *Sent:* Wednesday, 4 January 2012 1:41 PM
 *To:* cfaussie
 *Subject:* [cfaussie] CF Report Builder tool: any success stories?

 ** **

 I was just going through the cfaussie archives for anything on Report
 Builder.

 ** **

 not many posts (2 for 2011)

 ** **

 either: it's so simple to use, it gets results without headache

 or: not many people are using it.

 ** **

 Have people been able to successfully incorporate Report Builder into apps
 for end users to generate reports (and save CFR files to re-run at a later
 date)?

 ** **

 thanks

 Barry Beattie

 --
 You received this message because you are subscribed to the Google Groups
 cfaussie group.
 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.

 --
 You received this message because you are subscribed to the Google Groups
 cfaussie group.
 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.


-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.



[cfaussie] Re: OO Application Architecture

2012-01-03 Thread Gavin Baumanis
It's kind of funny - but just after having writtemn the initial post I was 
doing some work that was perfect for a service ayer / manager CFC.

Although very new, the DAO object was alrready in use, but was returning 
queries. 
Problem for me was; I wanted to do my new work using objects.
(The greater view, to perhaps implementing ORM eventually... so working 
with objects for the new work seemed sensible.)

So, I now have in my manager CFC, a method that returns an object populated 
from calling the underlying DAO getter. 

I certainly could have made the change in the DAO, and had it return an 
object instead of a query...
But... while I am not sure how common it is - I can drop back (easily) to 
the original query if needed, this way, too.
(to perform a query of queries perhaps?)

Also, in this instance, (the new work is relatively small in the number of 
object types required) - so I can certainly see the value in using the same 
manager CFC for the few objects / tables that we have deal with.

So - I think I have just talked myself back into using them again...
Sheesh - I might need an afternoon lie-down

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/-/Xx9BamB2AgQJ.
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.



RE: [cfaussie] CF Report Builder tool: any success stories?

2012-01-03 Thread Dale Fraser
No,

 

Our users don't do it, im not sure how well that would work, the tool is a
bit quirky, but with training might be ok.

 

I don't see why they couldn't use the tool and then have a webpage where
they can upload the cfr to use. The queries can be embedded in the report.

 

We tend to actually do the queries in coldfusion and pass the query into the
report but it can work both ways.

 

You would need a template when they upload to ask them what the input
parameters are, such as start date, end date etc.

 

Then have a coldfusion page that generates the prompts for that report.

 

Regards

Dale Fraser

 

http://dale.fraser.id.au

http://cfmldocs.com

http://learncf.com

http://flexcf.com

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of Barry Beattie
Sent: Wednesday, 4 January 2012 2:48 PM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] CF Report Builder tool: any success stories?

 

thanks Dale, appreciated.

 

any nasty limitations? (apart from the builder tool being on Windows only)

 

Do your end-users produce/manage the created CFR files? (a requirement is
for shared and per-user/individual custom reports)

 

thanks

B

On Wed, Jan 4, 2012 at 12:50 PM, Dale Fraser d...@fraser.id.au wrote:

We use it widely here,

 

It's actually a very good tool with limitations, but free.

 

Its integrated into our app and produces PDF reports.

 

The main advantage it has over cfdocument is pixel level control and
pagination.

 

Be happy to answer any questions you might have Barry, I believe I'm the
only user J

 

Regards

Dale Fraser

 

http://dale.fraser.id.au

http://cfmldocs.com

http://learncf.com

http://flexcf.com

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of Barry Beattie
Sent: Wednesday, 4 January 2012 1:41 PM
To: cfaussie
Subject: [cfaussie] CF Report Builder tool: any success stories?

 

I was just going through the cfaussie archives for anything on Report
Builder.

 

not many posts (2 for 2011)

 

either: it's so simple to use, it gets results without headache

or: not many people are using it.

 

Have people been able to successfully incorporate Report Builder into apps
for end users to generate reports (and save CFR files to re-run at a later
date)?

 

thanks

Barry Beattie

-- 
You received this message because you are subscribed to the Google Groups
cfaussie group.
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.

-- 
You received this message because you are subscribed to the Google Groups
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com
mailto:cfaussie%2bunsubscr...@googlegroups.com .
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

 

-- 
You received this message because you are subscribed to the Google Groups
cfaussie group.
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.

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.



RE: [cfaussie] Re: OO Application Architecture

2012-01-03 Thread Dale Fraser
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

 

http://dale.fraser.id.au

http://cfmldocs.com

http://learncf.com

http://flexcf.com

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of Gavin Baumanis
Sent: Wednesday, 4 January 2012 4:16 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: OO Application Architecture

 

It's kind of funny - but just after having writtemn the initial post I was
doing some work that was perfect for a service ayer / manager CFC.

Although very new, the DAO object was alrready in use, but was returning
queries. 
Problem for me was; I wanted to do my new work using objects.
(The greater view, to perhaps implementing ORM eventually... so working
with objects for the new work seemed sensible.)

So, I now have in my manager CFC, a method that returns an object populated
from calling the underlying DAO getter. 

I certainly could have made the change in the DAO, and had it return an
object instead of a query...
But... while I am not sure how common it is - I can drop back (easily) to
the original query if needed, this way, too.
(to perform a query of queries perhaps?)

Also, in this instance, (the new work is relatively small in the number of
object types required) - so I can certainly see the value in using the same
manager CFC for the few objects / tables that we have deal with.

So - I think I have just talked myself back into using them again...
Sheesh - I might need an afternoon lie-down

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/-/Xx9BamB2AgQJ.
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.

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
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.