Framework Feed
Item
2
Title: CFUnited: ColdBox Platform 3.0.0: Sustainable ColdFusion Applications
Presenter: Luis Majano
Date Recorded: Jul 31, 2010
Duration (hh:mm): 1:00
Submitter: Tim Cunningham
Description:
ColdBox is an event-driven conventions based ColdFusion Framework. It provides you with a set of reusable code, tools and best practices that not only make ColdBox an MVC framework but an Application Platform. Come learn how ColdBox can increase your productivity, standardize your applications and make you enjoy building ColdFusion Applications more than ever. This session will concentrate on the novel features of ColdBox 3.0.0: Memory Aware Cache, AOP Interceptions, Broadcast Interceptors, Helpers, Conventions, Model Integration, Plugins, Application Generation and so much more. Get ready to learn about this next generation ColdFusion Development Platform.
Recording URL: http://cfmumbojumbo.com/cf/index.cfm/cfconferences/cfunited-2010/luis-majano-coldbox-platform-300-sustainable-coldfusion-applications/
Read more...
Aggregated from: http://cfmumbojumbo.com/cf/index.cfm/cfconferences/cfunited-2010/luis-majano-coldbox-platform-300-sustainable-coldfusion-applications/
Item
3
Title: CFUnited: Designing Scalable and Creative Algorithms
Presenter: Elliott Sprehn
Date Recorded: Jul 30, 2010
Duration (hh:mm): 1:00
Submitter: Tim Cunningham
Description:
Vunderkind, Elliot Sprehn teaches you that even if you are as smart as him (doubtful) you should trust the ColdFusion Library to help you do you work in a creative and scalable way.Most problems have multiple solutions and with some thought and a little extra effort a more efficient algorithm can make all the difference! This topic covers how different solutions to problems such as merging, sorting, and caching can provide drastically different results and how various features like CF query objects can be used to accomplish them. We'll also cover some neat tricks that various frameworks, like Transfer ORM, utilize.
Recording URL: http://ow.ly/2pr7H
Read more...
Aggregated from: http://ow.ly/2pr7H
Item
4
Just a heads up that the server hosting barneyb.com and all it's various offspring (PotD, EventLog, etc.) will be going down about eight this evening to replace a faulty cooling fan. Total outage should be less than 15 minutes, and it will be a complete outage (the IPs will be dead).
Read more...
Aggregated from: http://feedproxy.google.com/~r/barneyblog/~3/7yIM_e2bJmI/
Item
5
So tonight I built cron in CFML. Again. Because it's missing from both the language framework and every runtime. Am I the only one who constantly fights this battle? In the past four years I've built four distinct cron implementations in CFML and it's completely retarded.
The JRE provides TimerTask, but it's a huge pain in the ass to use with CFML because the Java-to-CFML bridges are laughably weak. OpenSymphony has Quartz (which is awesome), but being Java, it suffers the same problem. Yes, even with the bennies CFGroovy offers in the Java space.
CFSCHEDULE is lame, especially on ColdFusion with it's 61 second frequency limit. Even with an optimal implementation the entire mechanism is flawed because it's a) stuck with equal iteration periods, and b) can only invoke URLs. Every distinct task requires punching a hole in your URL security, making a UI-layer facade for the task, etc.
The Java mechinisms are much better because they stay in-JVM (i.e., don't go through HTTP), but the statelessness of CFCProxy is a huge burden. You can't access already-instantiated CFCs, which means you end up writing a massive pile of custom facade/proxy code to interface with your already-running business model.
The natural solution, of course, is implementing cron in CFML. It allows you to pay either the HTTP or CFCProxy cost exactly once, as well as have cron's incredibly flexible scheduling format. This fact, in it's various manifestations, drives me to drink rather ridiculous amounts.
The flip side, of course, is the dynamic reloading nature that CFML servers offer. I simply cannot understand why other JVM frameworks have not copied this feature. The complete avoidance of all the JVM restarts and classloading hell is a benefit worth enormous sacrifice. Which, I suppose, is why I write CFML both for my salary and for personal projects.
Am I the only one who thinks this is a problem? With both CFML and other JVM frameworks.
Read more...
Aggregated from: http://feedproxy.google.com/~r/barneyblog/~3/4K9Wcdk4NXw/
Item
6
A couple years ago I wrote about using YUI Compressor to do built-time aggregation and compression of static assets. That works well and good if you have a build environment, but that's not always the case. So, still using YUI Compressor, I set up a simple script that'll do runtime aggregation and compression of assets using my favorite mod_rewrite-based file caching mechanism.
The basic idea is that your HTML includes a reference to "agg_standard.js", which is an alias for whatever JS files you need for your standard user (as opposed to a mobile user, for example). That request comes to your server and if the file exists, gets served back like any other JS file. If it doesn't exist, however, mod_rewrite will forward it to a CFM page to generate it:
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule (/my_app)/static/(agg_.*)\.js$ $1/aggregator.cfm?name=$2.js
In our example, the request passed to aggregator.cfm would have "agg_standard.js" as the 'name' attribute, which is how we'll figure out what we need to aggregate together:
switch (url.name) {
case "agg_standard.js":
files = [
"jquery/jquery" & (request.isProduction ? ".min" : ""),
"jquery/jquery.ui" & (request.isProduction ? ".min" : ""),
"yui/yahoo-min",
"yui/event-min",
"yui/history-min",
"util",
"jscalendar/calendar",
"jscalendar/lang/calendar-en",
"jscalendar/calendar-setup",
"dracula/raphael-min",
"dracula/graffle",
"dracula/graph"
];
break;
case "agg_iphone.js":
files = [
"jquery/jquery" & (request.isProduction ? ".min" : ""),
"yui/yahoo-min",
"yui/event-min",
"yui/history-min",
"util"
];
break;
}
The important bits, of course, is the Groovy script that actually does the aggregation and compression. It uses YUI Compressor, so you'll need to have the yiucompressor-x.y.z.jar file on your classpath (probably in /WEB-INF/lib). Here it is:
import com.yahoo.platform.yui.compressor.*
sw = new StringWriter()
variables.files.each {
def f = new File(variables.STATIC_DIR + it + '.js')
sw.append('/* ').append(f.name).append(' */\n')
if (! it.endsWith(".min") && ! it.endsWith("-min")) {
def compressor = new JavaScriptCompressor(f.newReader(), null)
compressor.compress(sw, -1, false, false, false, false)
} else {
sw.append(f.text.trim())
}
sw.append('\n')
}
variables.buffer = sw.toString()
Pretty straightforward: it just loops over the files, using a StringWriter to build up the aggregated buffer. Each file is either compressed into the Writer or simply appended based on whether the file has already been minified (based on ".min" or "-min" in the filename). Each file also gets a comment label in the Writer above it's contents so that the aggregated file is a little easier to parse (at the expense of a few extra bytes). Once done, the Writer's contents are stored in the 'buffer' variable caching on the filesystem:
<cfset fileWrite(STATIC_DIR & url.name, buffer) />
<cflocation url="#url.name#" addtoken="false" />
You'll notice that I'm not streaming the buffer back out to the user, but instead 302-ing back to the same URL. This is important. The reason is that Apache does a whole bunch of stuff to optimize static assets, and if I serve the content back with CFCONTENT, I'll miss out on all of that. Yes, the 302 has a little bit of overhead on the initial page load, but it reduces the total transfer size by several hundred KB (because of the GZIPping), and avoids a rerequest on the next page load (because of the cache headers). So it's completely worth it, the moreso because this is an application likely to generate extended usage rather than a content-centric site that is likely to see single-page "bounce" visits from search engines.
The last piece of the puzzle is handling versioning of your assets. When you change your JS file, you necessarily have to invalidate your cache (by deleting the files) so the aggregated version can be rebuilt with the new JS. The easiest way to do that is to use psuedo-versioning of your assets. You'll see a lot of sites will add a timestamp or a version number to their files (e.g., "arc/yui/reset_2.6.5.css" from Yahoo.com) so that when the update the file it gets a new filename, and is therefore redownloaded by everyone (because it doesn't exist in their cache). That's great, but it means you have to rename your files all the time which is kind of a pain. But you can fake it:
<cfset STATIC_ASSET_VERSION = 15 />
<script type="text/javascript" src="static/agg_standard_#STATIC_ASSET_VERSION#.js"></script>
That'll generate a request to "agg_standard_15.js", as you might imagine, which isn't going to work so well. But we can just change the 'switch' line from the first snippet to this:
switch (REReplace(url.name, "^(agg_.*?)(_[0-9]+)?\.js$", "\1.js")) {
Now it'll strip out that "fake" number string and switch on just "agg_standard.js", which is what we want. But that 'fileWrite' call later will still use the full filename (with the number embedded). That way subsequents will get the filesystem cacheing, the headers and GZIPping from Apache, and all the other love. And when you rev your files, you need only increment the STATIC_ASSET_VERSION variable and you'll have a brand new set of virtual URLs for all your assets, no fuss, no muss.
Oh, and just in case you're wondering, the aggregation and compression is fast. If you've ever used the command line or Ant task, you might fear that it's slow, but most of the time you see there is from the JVM spinning up, not the actual compression. Since this is all in-JVM, you don't pay any of that cost. It's certainly not fast enough to have it run in production on every request (hence the file caching), but it's totally reasonable to do on your production box as part of deploying a new version of the app. It's also probably fast enough to have running every request on your internal test/staging boxes, though that'll depend on how much you're aggregating/compressing among other things.
Read more...
Aggregated from: http://feedproxy.google.com/~r/barneyblog/~3/AyLVp-oxFzU/
Item
7
If you've ever used Grails, you probably know about the 'flash' scope that it provides for passing data from one request to the next. Certainly not a must-have feature, but it's quite handy. The typical use case is after a form submit, you set stuff into the flash scope and then redirect to some page where you use the flash scope's contents to spit a message back to the user. For example, after editing a user and submitting, you'd redirect the browser to the user listing page and display a "Successfully updated user" message at the top of the page.
The benefit of using the flash scope for doing this is that it only lasts one request, so if the user refreshes the listing page, they won't see the success message again (nor should they, since a user wasn't updated on the refresh). It also keeps your URLs clean (because you don't have to pass stuff along on the query string), and lets you pass complex data (since there is no serialization).
I'm sure a lot of people have faked this functionality in some sort of use-specific way, and I know I'm guilty. However, after preparing to do it yet again, I thought I'd build a more generic mechanism that I could reuse. Before I give you the actual code, here's how you might use it:
<cfcase value="onRequestStart">
<cfset flashScope = createObject("component", "FlashScope") />
</cfcase>
<cfcase value="updateGoal">
<cfset xfa.success = "goalList" />
<cfset goalService = request.beanFactory.getBean("goalService") />
<cfset goalService.updateGoal(
session.user.getId(),
attributes.id,
attributes.name,
attributes.definition
) />
<cfset flashScope.put("message", "Goal Updated Successfully!") />
<cfset location("#self##xfa.success#") />
</cfcase>
<cfcase value="goalList">
<cfset goalService = request.beanFactory.getBean("goalService") />
<cfset goalList = goalService.getGoals(session.user.getId()) />
<cfif flashScope.has("message")>
<cfset statusMessage = flashScope.get("message") />
</cfif>
<cfset include("dsp_goallist", "bodyContent") />
<cfset do("lay_auto") />
</cfcase>
As you can see, we're instantiating the flash scope at the start of every request. Then in 'updateGoal', the 'message' key is set into the flash scope. Finally in 'goalList', if there's a 'message' in the flash scope, it is set into a local variable (to be emitted within dsp_goallist.cfm). Pretty straightforward. The actual mechanism is a pair of structures: one in the request scope for incoming variables and one in the session scope for outgoing variables. The FlashScope CFC is nothing more than a facade to those two structures. This implies that you must have the session scope available to your application, of course.
I haven't created a full-on project for this but it garners sufficient interest and development activity, I'll certainly do that. In the meantime you can view/download the CFC (or if you're using Subversion, svn:externals it into your project).
In the interest of full disclosure, I want to call out two shortcomings in the implementation, both of which are intentional (to minimize complexity):
- There is no respect paid to dealing with concurrent requests. They'll happily intermix their variables in the flash scope, potentially causing errors and/or bizarre behaviour.
- The scope isn't really tied to the 'next' request, it's tied to the 'next request that reads the flash scope'. This can yield behaviour if your app assumes that the flash scope will be consumed, but it isn't for whatever reason.
Both of these would require some sort of nonce on every request, which adds a whole layer of complexity and necessitates passing some sort of request parameter on the URL or whatever. That's a) a mess, b) complicated, and c) application-specific. As such, I've opted to intentionally not handle those cases since they're edge cases and I'd rather keep things simple. That and I have this inexplicable obsession with 80-100 line, single-file microframeworks (see FB3lite, CFGroovy, TransactionAdvice, etc.). :)
Read more...
Aggregated from: http://feedproxy.google.com/~r/barneyblog/~3/-UwtqJJivAw/
Item
9
Team Mach-II proudly welcomes Brian Klaas to the team. For those of your around for while, you've probably seen Brian play devil's advocate a few times with the team over the years on the Mach-II Google Group. We're happy to see Brian on the team as each new member brings us new perspectives and talents to the table. On a personal note, Brian works at the Johns Hopkins University (my alma mater). I did not get the chance to meet Brian while I was at school, however I am proud that one of the wings of the university is actively using Mach-II. You have quite a proud alumnus here.
Here is a brief interview with Brian as we hope it helps you get to know him a little better. Welcome to the team Brian! We're lucky to have you!
Tell us a little about who you are and what makes you tick... I'm in charge of eLearning technologies at the
Johns Hopkins Bloomberg School of Public Health. I lead a group of 6 excellent employees who design, build, and deploy custom applications for online learning and training here at the School. We serve a global audience of about 7,000 people and the School was recently ranked as having the
#1 online program in Public Health.
While my primary role is that of architect and strategy lead, I also write a whole lot of CF code when I'm not collaborating with our customers about upgrades to existing applications and the development of new applications. I love that I get to mix customer research, UI experimentation, and code development in my day-to-day job. I also do quite a bit of face-to-face training with faculty and staff here at the School, and teach an "Introduction to Online Learning" course (offered only online, of course) that's taken by about 2,500 people every year.
I'm a terribly lazy if super-detail-oriented person when it comes to writing code. I like everything to look just so while letting a framework do a lot of the complex, heavy work for me. That's part of the reason why I really like Mach-II.
What was the first thing you ever did with a computer that made you proud of your accomplishment? I built a small Pac Man-style game in BASIC for my Atari 400 that eventually got published in a small, now-defunct magazine. I don't have a copy of the magazine nor the code any more, but at the time I thought it was pretty cool that I was a published computer programmer at age 14. (So, yes, I just totally dated myself.)
What got you started using Mach-II? When CF added support for CFCs in version 6, I had reached a point in my career where I felt like I knew a whole lot about developing using CF and procedural development styles. I had written some Java applets and a couple Java-based socket servers in the years prior to that, and wanted to make the leap, full time, to object-based Web application development. While I knew that CF MX wasn't purely object-oriented, it was object-based and that was reason enough for me to get started. Around that same time, Sean Corfield wrote pretty extensively about this new framework for building Web applications with CF called Mach-II. I figured that if that smarty thought Mach-II was good enough for both him and Macromedia, it was worth my time.
My first Mach-II application wound up being this huge training application with over 2000 lines in the main Mach-II XML configuration file. So much for learning via a small test application! I cringe every time I look at how that app is architected, but it was an indelible learning experience. Now I won't develop a CF Web application without Mach-II.
Mach-II has matured a lot since its inception. What are your favorite Mach-II features as of today? Modules top my list. My team recently released a project with 22 modules, and the flexibility that the Mach-II module architecture brings to the table allowed us to develop these modules in tandem, mock out what we needed until implementation, then swap out implementations simply and easily. Module inheritance when dealing with things like ColdSpring-managed beans is simple and elegant, and configuration inheritance and module-level changes are a snap.
I'm also a big fan of the call-method command introduced in Mach-II 1.8. I wrote a
blog post declaring my love for the call-method command.
Everybody brings unique ideas and skills to the table. What one thing you feel you bring to Team Mach-II? I have a hard time keeping my mouth shut, so I feel that I bring a need to talk about the framework, document the framework, and help the super-smart folks actually writing the code come up with requirements that really meet the needs of the developers (current and potential) who use Mach-II.
It's an impossibility to spend 100% in front of a keyboard. What do you do for fun? Half my fun comes from being in front of the keyboard, just not doing work. I've played World of Warcraft for five years now, and have been the leader of a great little guild for two of those years. I've learned a lot about design from the geniuses at Blizzard, and the game is hella fun to play.
During the spring and summer, when I can actually be outside and not suffer frostbite, I spend quite a bit of time in the garden. My partner has transformed our bland backyard in to something of a paradise, with a couple of ponds, multiple waterfalls, and tons of beautiful foliage. It's a lot of work to maintain, but the dirt feels great in my hands.
If you were not a programmer, what would you want to do with your life? I'd go back to directing theater. I ran a theater company here in Baltimore for 11 years, and while it was a transformative experience, when it all ended, I was very happy to get my life back. I do miss the process, though, and the people. The creative process in theater is incredible, with so many people contributing to this dynamic thing called the performance, and I do miss taking that journey on a regular basis. I've always said that if I were to win the lottery, I'd start another theater company after I got back from my summer in Provence.
Permalink
| Leave a comment »
Read more...
Aggregated from: http://feedproxy.google.com/~r/machii/~3/GL9Njy55v24/introducing-new-team-mach-ii-member-brian-kla
Item
10
If you are like me and have a thousand millions things to work on and lack focus. This little app will help you out. Its called Focus Booster: http://www.focusboosterapp.com/
It is a very simple focus timer that sits on your desktop and helps you do Pomodoro times. If you are not aware of the Pomodoro Technique, it is a technique to help you focus on tasks.
The Pomodoro Technique™ is a way to get the most out of time management. Turn time into a valuable ally to accomplish what we want to do and chart continuous improvement in the way we do it.
They offer their book free in PDF format or you can order their full Pomodoro Kit. I recommend you guys take a look at it.
The basic unit of work in the Pomodoro Technique™ can be split in five simple steps:
- Choose a task to be accomplished
- Set the Pomodoro to 25 minutes (the Pomodoro is the timer)
- Work on the task until the Pomodoro rings, then put a check on your sheet of paper
- Take a short break (5 minutes is OK)
- Every 4 Pomodoros take a longer break
Share and Enjoy:
Read more...
Aggregated from: http://www.luismajano.com/2010/08/12/get-your-pomodoro-focus-on/
Item
12
It's exciting times at the Mach-II Project. Just after our 7th birthday, we are proud to announce that Jorge Loyo has joined Team Mach-II. Welcome aboard Jorge! Below is Jorge's bio:
Jorge Loyo - Developer & Resident Mexican (everyone needs one) Jorge Loyo was raised in the small town of Tuxtepec, Oaxaca, Mexico until the age of 14 when he left Mexico (legally, in case you were wondering) leaving family and friends behind to study at Valley Forge Military Academy & College in Wayne, PA. It was there that he completed his High school and Associate degree in business. He then ran away from the cold and moved to Florida where he attained his Bachelor degree in International Business, Finance and Management Information Systems from Florida International University as well as a Master of Science in MIS from the same institution.
Jorge worked for the University for several years developing various internal systems, some of which in his last year (2005) where written using Mach-II. Since 2006 Jorge has been working with an online retailer helping redesign and rewrite all their databases and online applications. Also, he has been continuously assisting a Hispanic publishing group with their web infrastructure. Finally, in 2007 Jorge started his own Financial education business trying to help families become properly protected, debt-free and financially independent.
We always like to have a quick interview with new team members so the Mach-II community can get to know them and I've been surprised a few times. The team even now has a resident skydiver! Here is our interview:
Tell us a little about who you are and what makes you tick... Well, I like all types of music and really enjoy meeting new people. I love a good wine and spending time with family and friends, the more the better...
What I do not like and try to stay as far away as possible from is negative people that all they do is find something to bitch and complaint about. People that believe some circumstance other than their own actions is not allowing them to succeed at something. People who believe that others are just lucky.
What was the first thing you ever did with a computer that made you proud of your accomplishment? My first event computer programming class (VB6) I created a small timesheet program to calculate the hours I was working at that time for the computer lab at the university... I felt soooo proud of what I did :-). I showed that little program to some guy who turned out to be looking for a developer and hired me as a programmer for the university...Nice.
What got you started using Mach-II? At the university there was a team of 4 developer with no prior experience, including myself, in programming so EVERYBODY was developing whichever way they thought was best... Maintaining the systems over the years became a nightmare and I wanted to put a stop to the madness by implementing ANYTHING to help us... I did a little research with another co-worker and found MachII. I haven't looked back since.
Mach-II has matured a lot since its inception. What are your favorite Mach-II features as of today? Wow, tough one since I like and rely on many features, but time savers/code minimizers have been call-method, view-loaders, subroutines, auto-injection and message-susbscribers. However, currently I am in love with the custom tags let's keep them coming, they are AWESOME. Also, I cannot wait to use the EndPoints.
Everybody brings unique ideas and skills to the table. What one thing you feel you bring to Team Mach-II? I don't know if there is one unique skill or idea in particular because as all other teammates must do all the time, I like to think of what else could MachII do, what else could make my life easier... I like to think of all possible features that could be included.
One thing I can say, once something is in my head I will not sleep until I have it done. I will ask for help if I need it and won't pretend I can take on the world alone. I don't like to let teammates down and I will do everything possible to contribute to the framework.
It's an impossibility to spend 100% in front of a keyboard. What do you do for fun? Believe it or not, I am either at my job, at home, training new teammates for my business or meeting with clients.
I am a licensed skydiver and love martial arts, but I haven't practiced in some time, I've resorted to simply running, swimming and boxing whenever I can squeeze in a few minutes in my day.
If you were not a programmer, what would you want to do with your life? If I wasn't a programmer and didn't have my business, which I love. I would be a professional skydiver... I would compete in team jumps and travel to world to do base jumps from everywhere I could.
Permalink
| Leave a comment »
Read more...
Aggregated from: http://feedproxy.google.com/~r/machii/~3/1c_Q8cFHrpE/introducing-new-team-mach-ii-member-jorge-loy
Item
14
Time flies doesn't it? This month celebrates our 7th birthday as a project. We've grown up a bit since our humble beginnings in August 2003 and past several large milestones so far. We've had 13 stable releases since we started and we have 2 more (1.8.1 maintenance release for 1.8.0 and 1.9.0 Integrity) in the wings being worked on. We've seen the torch passed from the original authors of the framework to the current Team Mach-II a few years ago. We think things are going absolutely fabulously.
The best gift you can bring to the party is to bring the gift of your time by contributing back the framework you know and love. There's plenty to do from documenation, sample applications, enhancements to the dashboard, new things for the website and more. If you don't know how to get involved, feel free to ping us at team [at] mach-ii.com for help. Or you can promote the framework by writing a blog post about one of the features you are using in the framework (ping us so we can feature your blog post ).
Happy 7th Birthday Mach-II! May we see many more years in this new age of CFML development.
Permalink
| Leave a comment »
Read more...
Aggregated from: http://feedproxy.google.com/~r/machii/~3/FEjrW0ADDL0/happy-7th-birthday-mach-ii
Item
16
Mach-II rocks. It is one of the more "mature" surviving ColdFusion application frameworks, and as such doesn't get nearly the amount of buzz that the new (interesting, different, creative, awesome-in-their-own-way) frameworks get. If you're looking at frameworks, I encourage you to take a look at the amazingly capable Mach-II - we've had fantastic success with it!
Things I really, really like about Mach-II:
Backwards compatibility
Take an old (Mach-II 1.1 app, circa 2006) and update the framework to 1.8 (released 2009). Replace the application.cfm file with application.cfc, comment out everything in index.cfm and *boom*...you're done. I can't really assess how challenging it is for the team to maintain backwards compatibility, but I sure do appreciate how simple it is to upgrade. Instant feature add with zero headaches.
Coldspring integration
<include file="./mach-ii_coldspringProperty.xml" />
and in your listeners:
<cfcomponent name="mpListener" extends="MachII.framework.Listener"
depends="howConfigManager,mpManager,reportManager,notificationManager">
I don't think it gets much easier than that. Instant Coldspring integration for dependency injection (and more), radically simplifying the configuration of all of my listener and model cfcs. Now we've got all the power of Coldspring cleanly available to our Mach-II application.
Faster Fixes
Knowing where to find things is one of the hallmarks of any good framework. Some do it by convention, some by configuration. Mach-II falls into the latter camp but that's perfectly fine by me. Getting back into the mental model of an application months (or years) after deployment is a challenge but by simply cracking open mach-ii.xml I can see what happens where within seconds and bend it to my will. I love this.
Modularity
This wasn't in the framework back in the 1.0 and 1.1 days (when we created some mammoth apps), but by 1.5 (which came out in 2008) the ability to break up large Mach-II applications into separate modules was baked in and oh-so-handy. It's two years later and we've been able to make the easy changes to break those older apps into a collection of modularized sub-apps for much easier maintenance. Perfect example is an extranet: lots of only slightly related apps put under one common umbrella sharing security or UI components. This is easy to implement and support in a well-designed Mach-II application. All of our more recent apps make use of this feature.
The Team
The people who created and have since improved and evolved Mach-II are some of the smartest folks who are or have been involved in the ColdFusion community. Look at this list. Not only have they created something awesome, but they're incredibly responsive on the wiki, development Google group, and framework users Google group. They use this framework at their day jobs so you know that each release has been painstakingly designed, implemented, tested, re-tested, piloted and then released. Plus, they're open to new ideas (even if you personally have no idea how to make them happen!). Code is great, but the people are the best.
The View Loader
This is where some of those "convention-based" concepts have crept in to Mach-II much to the benefit of the users. Back in the "bad old days" your mach-ii.xml file would contain a block that looked sorta like this, except far longer:
<page-views>
<page-view name="showWelcome" page="views/showWelcome.cfm" />
<page-view name="showHome" page="views/home.cfm" />
<page-view name="baseTemplate" page="views/baseTemplate2010.cfm" />
<page-view name="blankTemplate" page="views/blankTemplate.cfm" />
<page-view name="welcomeLanding" page="views/welcome_landing.cfm" />
<page-view name="showSendPassword" page="views/showSendPassword.cfm" />
<page-view name="showAppHelp" page="views/showAppHelp.cfm" />
(and so on)
Each page would have a page-view defined. Someone called shenanigans on it and now we have the PatternViewLoader to replace ALL of it!
<page-views>
<!-- This would load all views with the pattern of "/views/**/*.cfm" which is the most basic and common pattern -->
<view-loader type="MachII.framework.viewLoaders.PatternViewLoader" />
</page-views>
So, so simple. Love this line of the config file more than any other.
Better apps, faster.
Take Mach-II off the shelf and use it as your "glue." Add Coldspring to manage your model. Use ColdFusion 9's new Hibernate ORM capabilities to cut the lines of code in your model by a huge factor. Redirect some of the saved time into building a better UI using jQuery, improving your cross-browser capabilities with clean CSS and making your client happier by communicating more frequently. Result: a better app, designed to be maintainable and much more in line with your client's spoken and unspoken expectations. How could any craftsman not feel good about that? Mach-II is a key component to that successful formula for us.
Try Mach-II. Need help? Talk to the team on the list. Build great things.
Thanks for your kind words Steve. Team Mach-II loves to hear it when people say things "just work". I hope to hear more posts from you on Mach-II in the future.
Permalink
| Leave a comment »
Read more...
Aggregated from: http://feedproxy.google.com/~r/machii/~3/uPWbkIj_dCo/countermarch-systems-blog-mach-ii-is-still-aw
Item
17
Team Mach-II is proud to release the Mach-II Dashboard 1.1.0 - Release Candidate 1 (RC1). This version of the dashboard is for Mach-II 1.8.0+ and include a bunch of new features not available in the previous version of the dashboard:
- Reload individual listeners, plugins, filters or properties without reloading the entire application
- The ability to use Google Charts instead of the built-in charting in your CFML engine
- On-demand JVM garbage collection button
- New AJAX interface
- New RegEx tester tool with RegEx Quick Reference Guide
Download the Mach-II Dashboard 1.1 RC1 now
Permalink
| Leave a comment »
Read more...
Aggregated from: http://feedproxy.google.com/~r/machii/~3/KA6rmes49kc/dashboard-11-rc1-available-for-mach-ii-180
Item
18
One little caveat when working with CFBuilder is that I was not getting the file preview working on the IDE because it was complaining that my project was not the root of the selected server as you can see below:

The problem is that Builder knows the root of the server but my application project is not on the root of server but on a folder embedded in it. So in order to make this work, just add a URL prefix to the project. Right click on the project and click on “SET URL Prefix”:

Click on it and you will get the following dialog and fill out the FULL URL, I tried just the directory, but it did not work, maybe a bug in Builder. So put the FULL URL.

Hope this helps, enjoy!
Share and Enjoy:
Read more...
Aggregated from: http://www.luismajano.com/2010/07/30/url-prefix-cfbuilder-nested-applications/
Item
19
Just a quick reminder that there is Birds of a Feather session for Mach-II at CFUnited this year. This BoF is hosting by our very own Kurt Wiersma.
When: Thursday, July 29th from 6:30 - 7:30
Where: CFUnited - Conant
Whether or not you are a user of Mach II consider attending this discussion about Mach II and building object orientated applications. We will chat about the news on the latest features in 1.8 and 1.9 releases, how to get started learning the framework and OO programming, and where Mach II is headed in the future. We will also share tips, tricks and resources for using Mach II to build powerful CF applications. We would love to hear how you have used the framework to build cool applications. We value the community's feedback about Mach II and look forward to seeing you there.
We've recently committed some great features into Mach-II Integrity (1.9) such as metadata based REST support where you code in CFML not XML! Thanks to Doug Smith and the guys at Dave Ramsey for working with us to create a killer new feature for Mach-II. If you looking to do REST based services in the future, this BoF is not to miss!
Permalink
| Leave a comment »
Read more...
Aggregated from: http://feedproxy.google.com/~r/machii/~3/sejaQ8qG2d8/mach-ii-bof-at-cfunited-friday-july-29-630-73
Item
20
Guess what time it is, kids!!
It's "Barney still wants CFML closures" time! Yay!
Today's impetus is Edmund, Sean Corfield's event driven programming framework. In order to register event listeners, you have to a CFC instance with a specific method to be invoked on it, and which accepts an Edmund Event as it's sole argument. Which means you have to have these silly little CFCs hanging about that simply get the event and then hand it off to the appropriate business components to actually do stuff. Yes, I understand that's a very OO way to do it: lots of little, purpose-specific types passing messages between them. But it's a bitch with CFML because every type has to be it's own file and you don't get context inheritance.
In Java most of the time your event listeners are anonymous inner classes – instances of classes that are defined inline. That mechanism gets a lot of grief, and while I agree that it's a little more verbose than necessary in simple cases, it's a lot better than the crap that static typing and/or checked exceptions foists on you, and having a full class definition can be useful as things get more complex.
Groovy smoothes that a little by allowing you to define Closures and use them instead. Under the hood, it's just converting them to your standard Java anonymous inner classes, but the syntax is rather nicer. If you know Ruby, think lambdas.
This is what I'd do in Java:
edmund.register("eventCreated", new GenericHandler() {
public handleEvent(Event e) {
beanFactory.getBean("eventservice").postprocessEvent(e.value("eventId"));
}
});
or in Groovy:
edmund.register("eventCreated", {
beanFactory.getBean("eventservice").postprocessEvent(e.value('eventId'))
})
But in CFML, I need to create a separate type (in a separate file):
<cfcomponent>
<cffunction name="init">
<cfargument name="beanFactory" />
<cfset variables.beanFactory = arguments.beanFactory />
</cffunction>
<cffunction name="handleEvent">
<cfargument name="e" />
<cfset beanFactory.getBean("eventservice").postprocessEvent(e.value("eventId")) />
</cffunction>
</cfcomponent>
And then register it like this:
<cfset edmund.register("eventCreated",
createObject("component", "MyEventHandler").init(beanFactory)
) />
What a mess. Not only do I have to create a separate file to have that one single line of code in it (line 10), but I also have to worry about passing context around (in this case, the beanFactory), because the CFC instance doesn't inherit the context it's instantiated in (as closures and anonymous inner types do). And this is a ridiculously trivial example. Here's what I'd like to see in CFML:
edmund.register("eventCreated", function(e) {
beanFactory.getBean("eventservice").postprocessEvent(e.value("eventId"));
});
You can see that I'm following the ECMAScript-like nature of CFML expressions and stealing ECMAScript's function literal syntax (one of them, at least) to create an anonymous function. In order for this to work, it'd have to be a closure (as ECMAScript functions are), not just a context-free function. As an alternative (which is more complicated, but which has certain advantages in certain scenarios), would be to have a CFC literal (anonymous inner CFC) as well:
edmund.register("eventCreated", new component() {
function handleEvent(e) {
beanFactory.getBean("eventservice").postprocessEvent(e.value("eventId"));
}
});
Personally, I'd much prefer the closure if I only got one, but both would be nice. The semantics of anonymous inner types can be a little wonky, and the advantages over simple closures is small, but they can still be really useful. Now that we have a CFSCRIPT-based way of defining components, the language at least has syntactic constructs to express anonymous types, so it's theoretically possible.
So since I can't do all this neat stuff, you might ask what I did do. I used ColdSpring with a purpose-sepecific adapter I wrote, along with a custom extension to Edmund to allow registering listeners from ColdSpring. So my Edmund config looks like this:
<bean id="edmund">
<constructor-arg name="asyncByDefault"><value>false</value></constructor-arg>
<property name="eventListeners">
<map>
<entry key="eventCreated">
<bean class="edmund.framework.ColdSpringListener">
<constructor-arg name="handler"><ref bean="eventservice" /></constructor-arg>
<constructor-arg name="method"><value>postprocessEvent</value></constructor-arg>
</bean>
</entry>
</property>
</bean>
The ColdSpringListener bean simply takes care of delegating the configured method to the supplied bean when it is triggered, passing along the event arguments along. This obviously is still pretty verbose, but the per-listener overhead is four lines of XML (in an existing file), not a 13 line CFC (in a new file). That counts as a win by me. The way I extended Edmund allowed passing a single listener or an array of listeners. The method I added is here:
<cffunction name="setEventListeners" returntype="any" access="public" output="false"
hint="I register multiple new listeners at once. I DO NOT REPLACE listeners,
despite being a setter. I should be named addMultipleEventListeners, but must
be named setEventListeners so I can be used from ColdSpring.">
<cfargument name="listeners" type="struct" required="true"
hint="I am a struct with event names as keys and either a single listener or
array of listeners as values. Note that there is no way to specify the
handler method or whether listeners are asynchronous." />
<cfset var e = "" />
<cfset var i = "" />
<cfloop collection="#listeners#" item="e">
<cfif NOT isArray(listeners[e])>
<cfset i = listeners[e] />
<cfset listeners[e] = arrayNew(1) />
<cfset arrayAppend(listeners[e], i) />
</cfif>
<cfloop from="1" to="#arrayLen(listeners[e])#" index="i">
<cfset register(e, listeners[e][i]) />
</cfloop>
</cfloop>
<cfreturn this />
</cffunction>
So is this good stuff? It's OK. It's solid for a CFML solution. But there is no question that it pales in comparison to the elegance with which you could solve the problem in other languages. Java (same age as CFML) has this, Ruby (a little older than CFML) has this, Python (much older than CFML) has this, and don't even get me started on Lisp (more than double the age of CFML). It's not a concept new to computer science.
Alright. Rant over. Until next time I seriously consider rebuild huge swaths of CFML in Groovy just for closures and start yelling again.
Read more...
Aggregated from: http://feedproxy.google.com/~r/barneyblog/~3/BsghEYS_yIs/
Mailing List Feed
Item
1
This is where I think having applicationStop() is such a nice addition to
CF.
If you have a URL that calls applicationStop(), you don't have to worry
about the threading issue, because CF manage it for you.
Mark
More...
Item
2
Nice work Ken.
Curt
Sent from my U.S. Cellular Android device
----- Reply message -----
To: "ColdBox Platform" <coldbox@googlegroups.com>
I wanted to post this to the community, hope it helps someone. Please
give feedback if you notice anything that could be done better.
Thanks!
Problem:
Under heavy load, we have had trouble reinitting the framework.
More...
Item
3
I wanted to post this to the community, hope it helps someone. Please
give feedback if you notice anything that could be done better.
Thanks!
Problem:
Under heavy load, we have had trouble reinitting the framework.
Recently during a large auction for one of our biggest clients, I
accidentally hit a link in my browser's URL history and fwreinit'ed
More...
Item
4
I take it nobody knows?
Regards,
Andrew Scott
[link]
is
More...
Item
5
Hey Matt,
The original question/statement was actually mine and was essentially,
"I don't understand why my Mach-II app is not picking up changes to
Mach-II config variables in App.cfc unless I restart the server"
Where this all came from is I am putting together a new app, and
before deployment I went to change mach-ii.xml to mach-ii.xml.cfm. In
More...
Item
6
That's strange--I've never had to go to these lengths.
Just because I can't let this go without commenting ... ;-) IIS vs. Tomcat
is apples and oranges. IIS is a web server, and Tomcat is a Java servlet
container. The equivalent to Tomcat on the CF side of things would be JRun,
which is the JEE server that ships with CF. (As an aside, JRun is ancient,
More...
Item
7
Brian, I have been needing to restart my local CF server for nearly
ALL changes I make to CF components. Like you, I tried clearing the
template & component cache but it usually doesn't work. My pattern is
to close CF Builder, restart the CF App Server service, go to my local
web server, and test my page. If I need to make more changes to my
More...
Item
8
Try m6
Sent from my iPhone
More...
Item
9
Try coldbox 3
Sent from my iPhone
More...
Item
10
What versión of coldbox.
Sent from my iPhone
More...
Item
11
It does and is what I am doing, the problem is that pattern variable :name
is not available in the module.
Regards,
Andrew Scott
[link]
make
More...
Item
12
You should be able to define a pattern that matches the location to
your module in the host application.
addModuleRoutes(pattern="/some definedvar/:name/admin",module ="admin");
if somedefinedvar is configurable, you could tie this to a setting and
make your module routes dynamic:
addModuleRoutes(pattern="/" & getSetting("settings")["someDe finedVar"]
More...
Item
13
Below is another example of this issue. I had done a refresh in my
browser (FF). All was okay. I then realized I wanted to change the
string within a couple logging messages, no variables, just further
info to clarify the message. I refreshed the browser again after
saving the source and received:
More...
Item
14
I am sporadically receiving the following error. The particular
handler changes. I am not sure what could be causing this problem.
Certainly, my main is wired up properly at some point for I have had
logging messages out of it. And, I have not changed anything in main
for over a month. I am using CB 3M5, with CF 9 on IIS. Any
More...
Item
15
It appears the caching in CB 2.6.4 has an issue with url encoded
values. No event with a URL encoded query string will cache for me.
However, if the encoding is removed the caching functions properly.
Can you advise me on how I might overcome this issue?
Thank you.
More...
Item
16
I am looking at doing something that I am not sure is possible with the new
modules, so if anyone has some experience or even some ideas then I would
like to discuss this further.
The problem I am having is trying to get my head around calling the module,
but from a defined route to begin with.
So if I develop say a community type site and it has a url like
More...
Item
17
I switched the following on
coldbox.debugMode = false;
coldbox.handlersIndexAutoReloa d = false;
coldbox.configAutoReload = false;
coldbox.handlerCaching = true;
coldbox.eventCaching = true;
And started getting the following type of error, not all the time but enough
More...
Item
18
What are the param values? br Looks like you're passing a string to something that is expecting a number. br a target=_blank rel=nofollow href=http://ora-01722.ora-code.com/[link]/a br Mark
More...
Item
19
Hi, br pI'm using Transfer 1.1 with Oracle 10 Database on Coldfusion MX 7 with br the Hotfix 2. br pI'm trying to receive a resultset with transfer.get() on two different br server. br On the first server I get the correct resultset but the second server br throws an sql-error. It says quot;ORA-01722: invalid Numberquot;.
More...
Item
20
For some reason I'm having to restart my local CF server in order for
it to pick up changes to MACHII_CONFIG_PATH in Application.cfc. I
just want to understand what is going on because it picks up other
changes to Application.cfc, but doesn't seem to be picking up my Mach-
II settings.
I tried clearing the template & component cache's in the
More...