Monthly Archive for January, 2005

Me and My Feisty Mac

I swear, my Powerbook is the feistiest computer ever.  I just
installed the 2005-001 security update, rebooted, and Finder refuses to
run.  It just loads and crashes at about 2 second intervals,
indefinitely.  Most of my other apps work (FireFox, Dreamweaver,
etc.), but some don't (iTerm, Adium), so I don't know what's up.

Last time it got massively pissy like this, it was bad memory. 
But the clever guys down at Apple opted to use the TINIEST screws
imaginable, and I don't have a screwdriver that will even come CLOSE to
fitting in them, so pulling the sticks out to check isn't an
option.  So now I gotta either live without Finder and a decent
terminal (because Terminal just sucks), or go fork $30 for some schmuck
to unscrew three little screws for me so I can pull out my memory
sticks and see if that fixes it.  Needless to say, after
yesterday's experience, I'm loth to let any "presumed expert" come
close to my machine.

As nice as it is to have that big ol' screen, have *nix under the hood,
I've gotten to the point where I'd rather be running Windows, because
at least it's stable when it's taken care of.  And how friggin'
pissed does it make me to actually say that.

Fun with Computers

First some background: our primary office file server has been acting
up periodically for a while now, and recently has become much more
insistant.  All things considered, it'd done it's job remarkably
well, and without anything even approximating sufficient
hardware.  So after this morning's crash, we moved on getting a
new box to replace it.  The load is light (we have an office about
about 15), and space isn't an issue, so a low-end workstation tower
with an extra bit of memory is all we needed.

Then the fun started.  I strolled the block down from my office to
Northwest Computer Supply, and asked them for some parts.  I knew
basically what I wanted, but not the specifics, and (foolishly, you'll
see) trusted them to make that work.  The list was megar: a
motherboard, the cheapest P4 on the rack, 1GB of RAM, a cheap case and
a cheap CD drive.  I already had hard disks.  Pretty
simple.  Got my parts, and was back at the office in less than
half an hour.

Get everything installed except the processor, and realize numbnuts has
given me a motherboard for the wrong processor footprint (Celeron, vs
Pentium, I believe).  No No worries, I go to trade the P4 for a
Celeron; it's not like a file server needs much processing power. 
No can do, because I opened the processor box.  Fine.  I'll
get a new motherboard ($150 vs $97).

Come back to the office, pull everything back out of the case so I can
get the motherboard and take it down the street, exchange it, and bring
my shiny new P4-compatible board back to the office, and get it back in
the case.

Pull the RAM back out of it's sleeves, and go to put it in. 
Whoops!  It doesn't fit!  Back down the block.  "We
don't have any in stock, but we can order it for you.  Probably be
here Friday.  We can do overnight, but it'll probably cost an
additional $12 or so."  "Excuse me?  You want me to pay the
shipping, because your sorry ass can't read that the MB takes DDR2, and
you sold me DDR?"  Of course, I shouldn't have assumed he was
clever, he had just sold me an incompatible processor a couple hours
before. 

I returned the DDR, and went to the store on the next block to get some
DDR2, which they had in stock, and while it was more expensive, at
least is was in the county.  Back to the office, ready to finally
get this computer together.

Ha.

Everything back in the case, and go to hook up the power supply. 
Now I learn that numbnuts has managed to provide a power supply that is
incompatible with the motherboard. I had no idea this was even
possible.  So now I'm waiting.  Hoping.  Praying. 
Dear God, please let these idiots manage to fix their mess.  I
have little faith.

So, what have I learned today?  Never, ever assume that people
selling computers know ANYTHING, even if their job is nothing except
putting computers together.  I am absolutely flabbergasted that
this man has a job, and has had it for quite a while.  Perhaps
it's just been my unlucky day, but c'mon, the only things that fit
together were the friggin' IDE cables.  Of course, I should have
been suspicious when they refused to sell me a system without a copy of
Windows attached, and instead required me to buy unassembled parts, but
even so.  Needless to say, they will no longer be getting any of
my business.

ISITE Design

ISITE Design
is a big-money web dev firm in Portland, OR.  They recently
expanded to Boston, MA as well, judging by their web site. 
However, what's interesting to me is that for a while they had a
reasonably nice all-Flash site.  Definitely one of the better
Flash sites I'd run across.  That's now gone in favor of an
XHTML-based one.  They also have a Breeze presentation linked on
their homepage about measuring ROI on a Flash content.  Obviously
they did the math and decided that Flash wasn't appropriate.

I'm sure that I'm the only one this caught the eye of, but I think it's
a good sign that people (including high profile companies) are actually
taking the time to consider the ramifications of Flash, rather than
just jumping on the RIA bandwagon because is the "hot new thing." 
I've been saying for quite a while that RIAs are just simply not ready
for prime time, and pretty much been scoffed at.  They definitely
have their users, but they're still pretty narrow in scope.  And
yes, this is coming from a guy who's company's corporate web site
(which I built) is entirely Flash based.  Believe me that I went
kicking and screaming, and only acquiesced because they sign my
paychecks.

Whitespace Suppression

Christian Cantrell posted a blog entry about expanding CFML whitespace suppression by leveraging CFMX's J2EE underpinnings. There seems to be a fair amount of happiness that this solution was made known (especially such a simple one). Two things I see here:

  1. people need to stop thinking about CFMX and a CF server and start thinking about it as the J2EE application it really is. You're getting a hell of a lot of power, basically for free, and the vast majority (or so it seems) totally ignore it.
  2. this looks like a good product feature for CFMX to have natively, maybe even in Blackstone, though it might be too late in the dev cycle for that.

What makes this more interesting to me is that I had a private discussion with Vince from New Atlanta about BlueDragon's whitespace suppression capabilities last week. CFMX's definition of whitespace suppression (both the CF admin option, and CFPROCESSINGDIRECTIVE's behaviour) is that all whitespace between CFML tokens (tags or hash-wrapped expressions) is consolidated into a single space. All other whitespace is left alone. BlueDragon's definition (same scope) is that after the whitespace-suppressed block is fully generated, all runs of whitespace are replaced with a space.

These sound pretty similar, until you realize that BD is drastically modifying your page's generated content, which has great consequences for inlined javascript (try using a // comment), PRE-formated text, and content for TEXTAREA tags.  Unfortunately, BD doesn't provide CFMX-compatible whitespace suppression in addition to this built-in overall whitespace suppression, so your in-code whitespace suppression mechanisms are pretty much incompatible with one or the other. BD's mechanism, however, is of nearly identical scope to the servlet filter solution Christian blogged about.

I'm happy to say that in the next version of BD (partly as a result of my discussion with Vince), the whitespace suppression mechanism will compress whitespace in a slightly more conservative manner, being more aware of newlines and such. This should remove the problems with inlined javascript, but will not solve the PRE and TEXTAREA issues. I also suggested that rather than trying to do it all with one option, they should split the function into CFMX-compatible suppression and then separately generated-content whitespace removal, so that you can just do the CFMX-compatible part. We'll see if that happens.

Also, just to throw this into the mix, using things like mod_deflate will generally give you an enomrous savings over simple whitespace suppression, especially if you're using CFML's built-in suppression facilities effectively already.

Beans, Transfer Objects, and Other Mumbo Jumbo

There was a series of interesting threads on CFCDev today about
different types of objects, and how they play together to form a
complete OO system.  Couple that with a pretty active week in the
CF blogosphere regarding objects, and I think it's pretty safe to say
that CF development is growing up.  Definitely no longer just the
quick-fix dev tool for little apps, CF developers are starting to think
about pretty hard core development techniques, and with enough numbers
to warrant widespread discussion.  That's really cool in my view,
and should bode well for the community as a whole.

I want to
sum up a few things with quick definitions/discussions as kind of a one
stop shop, rather than having to look all over, so here goes:

Objects
- A collection of state (instance data) and behaviour (methods). 
A struct has state.  A UDF has behaviour.  An object has
both.  The state should be inaccessible to the outside world; it
can only be retrieved and manipulated via methods of the object. 
Some objects are very thin, with almost no behaviour, some objects are
very thick.

Business Objects (BOs) / Beans - These are
the heart of any object model.  They represent the entities within
the model, and hold not only the entity state, but also entity
behaviour. 

Transfer Objects (TOs) - These are
snapshots of the state of a BO, without any of the business
logic.  Their purpose is twofold: 1) to make passing the data
around easier (one object, versus a bunch of individual fields), and 2)
maintain the integrity of the BO's state, without requiring the BO
itself (the TO's state is immutable, and only accessible via
getters).  This should be a CFC with getters for each property of
the BO, but you can use simple "read-only" structs with similar effect.

Data Access Objects (DAOs)

- These objects provide a way for a business object's state to be
stored and retrieved from some "persistant store".  Usually this
means a database, but it might be a collection of XML files, or any
number of other things.  The idea is to isolate the BO from the
method in which it is stored, so you can transparently switch out
persistance mechanisms without affecting it.

Data Gateways
- These provide a related function to DAOs, but they aren't for a
specific BO (or entity), but rather for collections of entities. 
So where you might have a User BO and a corresponding DAO for it's
persistance operations, you'd have a gateway object for getting lists
of users, or other such multi-entity operations.

is-a, has-a
- These are the two core types of relationships between objects. 
Is-a relationships are inheritance, where you say "a Corvette is a Car
is a Vehicle".  Has-a relationhips are composition, where you say
"a User has a Role which has some Responsibilities".  Wherever
there is ambiguity between which type of relationship to use, the
natural instinct is usually to go with is-a, but the proper solution is
usually to go with has-a.  ; )

Object Modelling
-
The process by which you define and create the set of objects needed
implement a given set of business logic.  This is a VERY
complicated process, and is damn near impossible to get right on the
first try (or the third, or the tenth …).  It usually starts by
identifying the entities in the model, and then identifying the
relationships, and then identifying the types of objects needed to
represent them.  Once that's done, you go back and revise them,
checking for cohesion, loose coupling, appropriate use of patters, and
all kinds of stuff.   Then you revise again.  And
again.  Simple on paper, difficult in actuality; very
much an iterative process, no matter your level of expertise.

If you're interested in using OO with CFML, I'd highly recommend the CFCDev list
It's not particularly high-traffic (much, much less than CF-Talk), and usually
stays remarkably on-topic.  You might also check out An Architects View (Sean Corfield's blog), ClearSoftware.net (Joe Rinehart's blog), and Matt Woodward's blog.  Finally, I'd also recommend the ColdFusion news feed on FullAsAGoog.com, which includes all of these blogs (along with mine), plus with many others to numerous to mention here.

I'm Back

After a gloriously long holiday break (nearly two full weeks), I'm
finally back to real life.  I won't say that I've missed it, but
it is kind of nice to be back into a routine.  And now, the
obligatory quick recap.

Aside from a botched trip to Victoria, BC (things are closed on New
Years Day, imagine that ;), the holidays were quite nice.  It's
the first length time I've really gotten to spend with Lindsay, which
was very enjoyable.  She's almost a year old now. 
Amazing.  Got the mandatory Legos for Christmas, a very cool pneumatic truck
I managed to make an air-powered catapult with that set alone, but now
that I'm back home, I can mix it up with all my old sets, and I'm sure
something really cool will come of it.  Also while I was gone,
another check came in from Fusium, so I'm up to $450 in the Free Barney fund.

The app I've been working on (and the source of my BlueDragon woes) is
done.  It's a new backend for this site, including online image
editing and management.  Nothing complex, but enough to occupy my
evenings for a couple weeks, especially with the troubleshooting. 
As a Christmas present to my sister and sister-in-law, I set up a site
for each of them (Hawaii Boisverts and The Whisler Life, respectively) on the system, in addition to this site and The Boisvert Life.  They're now happily blogging away, photo galleries and all.

That's about it for the past two weeks.  Once I get a little more settled, the normal posts will resume.