Friday, September 6, 2013

My "View Adapter" Was Just a Façade

A name, even an inaccurate one, can be a sticky thing.  So it was with the jQuery abstraction layer I've been writing about.  Discussing it with my colleagues, I made the mistake of referring to it as a “view adapter” when describing.  That was rapidly how it was written into the code, how we began to refer to it and how I began to think of it.

However a new set of eyes pointed out the truth a few days ago: it’s a façade.

The adapter pattern translates one interface for use as an otherwise incompatible interface.  In a very broad sense we are doing this, but not for the purpose of gaining compatability.

The façade pattern provides a single simplified interface to a larger interface or set of interfaces.  This is exactly what we are doing.

By all rights, this class I've been dissecting ad nauseum should have been named a view façade, and so I've gone back and updated my posts and linked-to code references.

Because technically correct is the best kind of correct.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.