Example Mach-II 1.5/ColdSpring application
ColdFusionLast 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."






Loading....