HELP: Gateways, DAO's & Bans from DB Table or View??

2 views
Skip to first unread message

Jorge Loyo

unread,
Jul 2, 2008, 12:58:06 PM7/2/08
to Mach-II for ColdFusion
I am using Illudium CFC generator to create all my CFCs based on a
template I created for our project. However, I've come to a point
where simple data retrieval from a table no longer suffices in some
cases.

I'll use a simplified example...

In a shopping environment, an order belongs to a customer, so my
"tbl_orders" table contains a column "fk_customer", which links to the
"tbl_customers" table.

If I need to display a list of the current orders I would like to see
the customer name and not the Id... so, what I have been doing is,
within my gateway, add the "inner join" to get the customer info.

In some cases, the list of necessary inner join's is a lot larger...

How are you guys handling this??
Do you include the inner joins in the gateway??
Do you create a view in the database and create your gateways based on
views??
If so,
How do you manage the beans passed to the DAO's since in some cases,
you may need to change a column name in the view??

Help plz... Thank you!!!

Matt Williams

unread,
Jul 2, 2008, 1:46:13 PM7/2/08
to mach-ii-for...@googlegroups.com
If I have a need for joined queries so I can display lists, I
typically will have a separate function in the gateway just for that
purpose. The listener and service CFCs will have corresponding
functions also. Something like this goes in the xml:
<notify listener="orderListener" method="getCustomerOrders"
resultArg="qCustomerOrders" />

You can also use views for this purpose, just depends on how dynamic
the query is. These kind of queries & functions are something you will
have to write manually, though, as opposed to using Illudium.

--
Matt Williams
"It's the question that drives us."

vience

unread,
Jul 3, 2008, 2:56:59 AM7/3/08
to Mach-II for ColdFusion
If you are playing with Illudium CFC generator then create customize
CFC some like following will be a good start.

<cfcomponent

displayname="dynamic.service.database.t_group_permision.beanGatewayExtend"
output="no"
extends="dynamic.service.database.t_group_permision.beanGateway"
hit="[Customize SQL mysql Edition] Table: t_group_permision Muti-
Record Database Access Object for Mach-II application">

....your customize SQL inner join or others...

</cfcomponent>

Or try "transfer" or "reactor" will give you a hibernate-like database
operation interface.

http://www.transfer-orm.com/
http://www.alagad.com/go/products-and-projects/reactor-for-coldfusion

Jorge Loyo

unread,
Jul 3, 2008, 10:05:43 AM7/3/08
to Mach-II for ColdFusion
Thank you Matt and Vience,

So would this feature is handled by using Transfer or Reactor?? I've
never used either so I wouldn't event know where to begin.

What do you suggest?

Mark Mandel

unread,
Jul 3, 2008, 6:21:11 PM7/3/08
to mach-ii-for...@googlegroups.com
If you want to start with Transfer, the presentation recordings are a
good place, particularly the 'Introduction' one.

http://docs.transfer-orm.com/wiki/Presentation_Recordings.cfm

Mark

--
E: mark....@gmail.com
W: www.compoundtheory.com

Jason Blum

unread,
Jul 7, 2008, 11:24:46 AM7/7/08
to mach-ii-for...@googlegroups.com
Yeah Mark's presentation is excellent - and since you're asking on the
M2 mailing list, you'll probably be looking next at wiring it up with
ColdSpring and Mach-II, for which Brian Rinaldi's post on the subject
is helpful:

http://www.remotesynthesis.com/post.cfm/Building-an-Application-with-Transfer-ORM


Also as Sean Corfield and others have pointed out, Bob Silverberg is
doing a nice series on integrating Transfer into his application
development:

http://www.silverwareconsulting.com/index.cfm/2008/6/23/How-I-Use-Transfer--Part-I--Introduction


...I'm working through all this stuff myself - very very cool.


2008/7/3 Mark Mandel <mark....@gmail.com>:

Reply all
Reply to author
Forward
0 new messages