Thursday, May 25, 2006

Flex 2, MG4J, and Spring. Bliss...

Perfect timing! I just read this post on Sean's blog, about some of the pitfalls of building Flex front ends for existing Mach II apps and started to write a comment, but it got too long. So I figured I'd just post it. I'm currently working on a big conversion of an application from a very evil and horrible framework to ModelGlue/Spring and Flex 2. This one's Java, but really that's circumstantial at this point, everything is pertinent to CF. I thought it may be an interesting read to write out my development process for this project, so here goes...

I started by flowcharting everything the current app does, and putting names on each bit of data access that is descriptive (this app is bizarrely procedural in its current form!). From there I could identify what my Services would look like, and what methods they would need. That's pretty simplified, but it was almost that easy... Next I defined my DAOs and in certain places I created custom query objects. Too hard to explain, but there's some pretty hard core business logic about HOW to query for data in a lot of cases. Pretty much at the same time I designed the Domain Objects that I would be using at a higher level, raw data in more fine grained views.

OK, next step, test like crazy! That's not really true, because I tend to write test cases for every Domain object as I create them, then every DAO/Gateway as I create them, then all the Services, when I hook them up in Spring, and that goes on and on... The main point here is that I'm concentrating on building and testing my model alone, and constructing services, because I know I'm going to be targeting both Flex and a normal web based app.

So now on to the MG app. Views, controllers, a security system that is pretty standard to what I've been doing for years... This part is pretty easy, in my MG Controllers, I'll put a bunch of stuff in the event, and then I use it in views. Like every one...

Now I have a nice little MG app, and hey it's in Java and really wasn't too hard to write! Amazing, Spring JDBC was a life savor here, btw... But how does this get into Flex! Luckily since I was thinking ahead, even though I would have done everything this way anyway, accessing Spring managed services from Flex is no big deal. I created remote proxies for each of the services, which look up the Spring bean factory through the application context and then retrieve their respective service bean, then defined them in flex-remote-services.xml. That was well, pretty much it! Then I just wrote the Flex front end, and for the most part, the Java to AS object mapping is perfect. As I got deeper into it my proxies started to look a lot more like my MG controllers, as a single method to the service proxies may call multiple methods on a few different services even, returning data keyed in a hashMap. Kind of like adding data the current event in MG. And that's it, my current development process, and what I've been up to for the past few months. Hope it's helpful!

Thursday, May 11, 2006

Today's fluff...

OK, I liked the idea of Sean posting his all time top played album, so here's a few lists of my own. I was looking at the top play counts for all my music in iTunes, and they're kind of skewed, I think because of the way I listen to music. I'm a big fan of shuffle. But here's some interesting (maybe) things:

Last 5 albums played (because today I didn't shuffle!)

Mastodon - Leviathan, the saviors of the new Metal? Perhaps, but I doubt it...
Minor Threat - Complete Discography, I'm not going to transfer all my $5 records...
High On Fire - The Art of Self Defense, Stoner Metal at it's best!
Born Against - Nine Patriotic Hymns For Children, a huge influence on me...
Gang of Four - Return the Gift, Last year another great 80s band rerecorded their greatest. I simply cannot stop listening!

All time most played Songs:

Orange 9mm - Glistening (Driver Not Included), Used to be the singer of NYC hardcore band Burn, another big favorite
Clutch - Mercury (Blast Tyrant), OK, that's a complete surprise, no idea how that happened
Gang of Four - Damaged Goods (Return The Gift / A Brief History of the Twentieth Century), see what I was saying...
Oingo Boingo - Private Life (Nothing to Fear), another confusing pick there..
The Dillinger Escape Plan - Sugar Coated Sour (Calculating Infinity). Think Praxis, but add more metal. Very odd...

Well there you go, I'm not sure if that's the best representation of my musical tastes, but it's a pretty interesting way to look at someone. What do you like?

Saturday, May 06, 2006

Luray, VA, I'm on my way...

It's 8:45, Saturday morning and I'm about to leave on a 3 day motorbike trip with my pops. 30 W through southeast PA to Gettysburg, where we'll drive around the civil war battlefields and have lunch. Then 15 S to Frederick MD and on to 340 S/W. We maybe will take a break in Harper's Ferry National Park, then we drive to Front Royal, the top of Shenandoah National Park, where we'll pick up Skyline Drive and go about 1/3 the way to Luray. It should be a great long ride, I'll post picks when I return, and maybe on the way. I hope I keep the paint up!