0

Example Mach-II 1.5/ColdSpring application

ColdFusion

Last night I wrote a little application for recording CFUG meeting attendees. Someone on the Mach-II email list was asking for an example of code that would populate a select dropdown list with records retrieved from Gateway objects by way of a Service layer, and I offered this application as an example. If anyone is interested, the code can be downloaded at the link below and is bundled with both the Mach-II framework and ColdSpring.


From the Home page of the example:
"This is a sample Mach-II 1.5 /ColdSpring application whose purpose is to
record meeting attendance of CFUG members in order to make each attendance
record a virtual raffle ticket for our semi-annual software raffle.

Considering that this application shows some techniques working with Mach-II,
ColdSpring, and an OO data model using Service objects talking to
Bean/DAO/Gateway objects, I am releasing it as a sample application. It
should be noted that there may be certain practices in this application which
could be debated to no end, such as passing arguments from Listeners to
Services using 'argumentCollection'. In a stricter environment, it might be
wise to explicitly name your arguments so that you have a better visual
handle on the passing of data.

Additionally, you may notice that my beans need to have a service in order to
exist. There are many people who would probably disagree with this approach,
but doing this is what allows us to neatly have child
queries/arrays/iterators, which you can see the usage of on the ListMembers
event. As a rule in this particular model, a Foo.cfc will always depend on a
FooService.cfc. Take a look at the bottom of the Service cfcs to see how
these child relationships are managed. This is a technique that we use in our
applications that work quite well for us.

This application was really just written for my own use. Usability wasn't a
terribly high priority, but hopefully it will serve as an example for tying
several concepts together. If you have any
questions/suggestions/complaints/insults about this application, feel free to
post them to the Mach-II email list and I will do my best to respond there.
"

tags:
ColdFusion
 
Ok, so now that we have a list of attendees, can we do the drawing for cf8?

(my odds are pretty good right now)

:)
 
posted 864 days ago
Add Comment Reply to: this comment OR this thread
 
Jeff Gladnick said:
 
Dave,

I am new to mach II / Coldspring, and I downloaded your sample app and started playing around with it.

I have one question for you: Some of the functions in the listener CFC's need the path to the bean CFC defined. Like this:

   

But cant this be done with coldspring somehow. what if the path to the bean changed - we'd have to update all these paths right? I thought the whole point of coldpsring was to get away from this problem?

set me straight, and thanks for building the app!
 
posted 561 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Jeff Gladnick said:
 
it cut off my code - it should have looked like this

   cffunction name="getMemberMeeting" access="public" output="false" returntype="cfug.com.dfwcfug.model.MemberMeeting.MemberMeeting"

cfug.com.dfwcfug.model.MemberMeeting.MemberMeeting

 
posted 561 days ago
Add Comment Reply to: this comment OR this thread
 
 
I guess the short answer is that you could set the returntype to "any". I just tend to specify return types as a preference, but it is certainly not a requirement. Re: you comment about ColdSpring - it wouldn't come into play in that scenario as your listeners are not managed by ColdSpring, but even if they were ColdSpring doesn't care how you define returntypes in methods. It focuses on managing dependencies between objects. The fact that it abstracts physical pathing is a byproduct of that process imho. You will likely never get away from using paths at some level anyway. Take a look at the ColdSpring config! :)

This is sort of a scatterbrained and rushed reply, but I hope that makes sense.
 
posted 561 days ago
Add Comment Reply to: this comment OR this thread
 

Search