A Django site.
August 20, 2008

Hans Fugal
no nic
The Fugue :
» MVC

A friend of mine is struggling to grok the MVC pattern. I remember when I first tried to grok it how frustrating it was. There wasn't one final "a-ha" moment when I grokked it, but one day I looked back and realized I understood it. At that moment it dawned on me just how amazingly silly this whole process is. MVC is not some magical formula that if you implement it will endow your application with magical powers. It is a paradigm. A worldview of application programming. Once you get it, you realize that everything is MVC. It's just that some of it is cleaner MVC than others. The trick is in keeping the three components separate, but they're always there. My friend is still confused after an IM conversation, because his preconceptions about the computer and probably his desire to find that something different are getting in the way. So let's use a non-computer analogy.

You've seen The Hitchhiker's Guide to the Galaxy, right? Of course you have. If not, I'll wait.

Ok, remember the scene where Trillian is at a desk with a Vogon who asks her here home planet? She says it's Earth, the Vogon can't find Earth, she tells her where it is, she says it was destroyed, and does Trillian perhaps have another home planet? Yeah, I don't do it justice. Ok, so Trillian is the user. The Vogon is the controller, the computer is the database, and there are several views in play. The first view is the Vogon telling Trillian that it was destroyed. The second view is when she turns the computer monitor around so the incredulous Trillian can see for herself the video of the Earth being blown up. The third view is authorization with Zaphod's autograph.

The nice thing about MVC, see, is that the model has no clue about the view or the controller. It just provides an interface for the controller to get and change the model's information. Likewise the view is pretty dumb. It accesses the model, or a snapshot thereof. But it doesn't make decisions. It just displays stuff. The controller is the "brains" behind the operation. It coordinates showing the user the correct view of the bit of the model that the user wants to see. It handles updating the model with new information.

Ok, still confused? Let's try another. This time the controller is your CD player. The model is a CD. The view is your amplifier and speakers, or whatever else you have plugged into the audio outputs. An oscilloscope maybe? You the user push buttons and the controller changes the view. The model and view are obviously decoupled. But this analogy isn't perfect because the view isn't accessing the model directly, as is usually the case in MVC, but is being spoonfed the data by the controller. In my opinion this distinction is irrelevant, because the whole point is to achieve decoupling and whether the controller provides the decoupleable data or the view fetches it directly from the model is irrelevant to decoupleability, as we can see with this real-world example. Also this analogy might be better if we think back to cassette tapes which allow us to change the model (by recording), whereas the CD is read-only.

Ok, so now let's bring it to the computer domain. The model is a database. Actually it's usually a wrapper around a database (which is in turn usually decoupled too), like ActiveRecord or your homegrown classes. You almost always write classes, because representing "stuff" is what OOP is good at. It doesn't have to be a real database of course, it could be just objects in RAM or a flat file. The key word for models is data.

Now, the view is almost always entirely contained in the GUI toolkit you're using. The toolkit writers figured out all that boring stuff that lets you draw widgets and pack them together in a dialog box, etc. All that stuff you wouldn't want to do manually is the view. You may have some view code which deals with setting up the widgets, etc. The view may not even be visual—it might be a file on disk or sound coming out the speakers. The key word for views is render.

The controller is everything else. Those GUI toolkits usually have some controller help too, since GUIs are interactive views and the events that the controller reacts to are coming from the view, in a sense. When you write callbacks, you're writing the controller. The controller figures out what to do in response to various events. It decides how to manipulate the views. It tells the views what data to display. The key word is event, and maybe coordination.

So you see, if you're using a toolkit or framework you're already sort of doing MVC. The real litmus test can be boiled down to the following questions. If you can answer yes to all of them, then you're doing MVC. If not, you're not.

  1. Could I render different views without duplicating control code?
  2. Could I use my model code unchanged in a completely different application, and could I switch databases (if you have a persistent model) like I switch CDs?
  3. Is my model ignorant of the rest of the program?
  4. Do I feel like MVC is making my life easier, not harder?
  5. Have I sent chocolate to Hans recently?

There you have it. I hope it was helpful.

August 7, 2008

Phil Windley
pjw
Phil Windley's Technometria
» Defining the New Singularity

I'm stil catching up on my IT Conversations listening after being gone on vacation for 10 days. This morning I listened to Mark Rolston's talk from the Emerging Communications conference entitled The New Singularity. Contrary to what you might think from the title, this isn't about "the" Singularity, but rather the idea that we typically have one concept about what a product should and the phone belies that. I really enjoyed the thinking about products and designs. I found myself wishing I could ask a few questions!

Tags: itconversations design phones iphone

August 6, 2008

Dennis Muhlestein
nonic
All My Brain
» GTK+ programs with GtkBuilder and dynamic signal handlers.

Well, I decided to review some GTK+ and Gnome development lately. With GTK+, a nice way to create a user interface is with the Glade Interface Designer. Glade produces an xml file with a glade-interface element that can be loaded by libglade. You can then change attributes of the user interface without [...]

April 2, 2008

Jeremy Robb
scothoser
Scothoser's Corner
» Mac OS X 10.5 Support Essentials: With Regional Appeal

This week I have been teaching Mac OS X Support Essentials, and I’m really excited with this group. I have two students from New Mexico, one from Idaho, one from Wyoming, and the final student from Park City, Utah. It seems that our Apple classes are starting to draw a lot of students from across the West.

The class is moving along nicely, though the content is still really high. The poor students are hitting their cognitive load rather quickly, and so we can’t move more than a couple of chapters at a time. Unfortunately, that leaves us with about half the curriculum left to cover today. Luckily there isn’t a lot that the students need to learn at this point because all the heavy learning happened at the beginning of the course. Now we are just covering Networking, Peripherals, printing, and the startup sequence. But the students already feel overwhelmed.

Looking at the materials again, while I still contend they are better than the 10.4 materials (by a long shot), the course should have been made a 4 day course. Of course that brings up a whole different concern about the price tag on the course which most students and their employers already consider too high. It’s an interesting balancing act, particularly when you think about what is required, or expected, for this level of expertise.

Perhaps, when I have time, I’ll run through the materials with my magnifying lens, and see if I can’t find a better design for the course. Perhaps there are exercises that are redundant, or perhaps there are topics that are not that important. This all comes after I have finally had the time to write the testing software that I intend to create.

Finally, something that I would love to see from Apple, is a Learning or testing platform that could be run within a Virtual Machine and distributed through a network. Something like LivePC (more on that platform later, which has really impressed me!). It would make testing easier, and even easily distributed (though controlled through an access platform), so that more Apple Professionals can be out there. Perhaps if the requirement for the software to work would be to have it run on Apple hardware…

» Mac OS X 10.5 Support Essentials: With Regional Appeal

This week I have been teaching Mac OS X Support Essentials, and I'm really excited with this group. I have two students from New Mexico, one from Idaho, one from Wyoming, and the final student from Park City, Utah. It seems that our Apple classes are starting to draw a lot of students from across the West.

The class is moving along nicely, though the content is still really high. The poor students are hitting their cognitive load rather quickly, and so we can't move more than a couple of chapters at a time. Unfortunately, that leaves us with about half the curriculum left to cover today. Luckily there isn't a lot that the students need to learn at this point because all the heavy learning happened at the beginning of the course. Now we are just covering Networking, Peripherals, printing, and the startup sequence. But the students already feel overwhelmed.

Looking at the materials again, while I still contend they are better than the 10.4 materials (by a long shot), the course should have been made a 4 day course. Of course that brings up a whole different concern about the price tag on the course which most students and their employers already consider too high. It's an interesting balancing act, particularly when you think about what is required, or expected, for this level of expertise.

Perhaps, when I have time, I'll run through the materials with my magnifying lens, and see if I can't find a better design for the course. Perhaps there are exercises that are redundant, or perhaps there are topics that are not that important. This all comes after I have finally had the time to write the testing software that I intend to create.

Finally, something that I would love to see from Apple, is a Learning or testing platform that could be run within a Virtual Machine and distributed through a network. Something like LivePC (more on that platform later, which has really impressed me!). It would make testing easier, and even easily distributed (though controlled through an access platform), so that more Apple Professionals can be out there. Perhaps if the requirement for the software to work would be to have it run on Apple hardware...

February 11, 2008

Dennis Muhlestein
nonic
All My Brain
» Ten Principles Of Effective Web Design

Here is another article from Digg.com highlighting some effective web design techniques. I'm stockpiling these for the next time I have a new project that requires a new face. This one is particularly informative since it gives examples at the beginning of how users use the web and then shows how you can [...]

January 31, 2008

Dennis Muhlestein
nonic
All My Brain
» 8 Web Design Mistakes That Developers Make

I decided to make a blog entry for this so I can come back again and review it later. I fall exactly into the category of "developers creating websites". Luckily, most of the work I do, at least professionally, has someone else to be in charge of how it looks! I found [...]

December 20, 2007

Jared Ottley
nonic
Jared Ottley
» Another Design Tool

Saw this at northtemple.com.  Shared the link with the other Alfresco Solutions Engineers.  One of them shared back another tool, XRAY.

Ah, the power of javascript.


Jeremy Robb
scothoser
Scothoser's Corner
» Apple Training V: The Final Impressions

Now that I have things pretty much under control back home, I promised that I would post my impressions on the Apple Training upgrade to 10.5 that I attended for the past two weeks.

The Design
Overall, the design actually follows some instructional design techniques, unlike the Tiger materials. The student, as they progress through the course, must utilize the techniques, steps, and knowledge they had acquired in previous chapters. Building upon the previous material the students are reinforced in that material, and are not treated as mindless children that can't learn. Constructivist theories at the heart of it, which makes me happy. THe command line is no longer separate from the individual events that the commands apply to, but rather you learn the command line all through the book. Finally, the training becomes professional, and therefore something I am proud to offer at the University.

The Materials
The materials are being published through PeachPit, though the student kits will only be available to an Apple Authorized Training Center. They are very well done, with bits of the lecture in with the slide presentations. They no longer follow the Reference book, which has additional assignments should someone want to continue on with their learning in another direction. The only thing that I currently see wrong is having a place for notes, should the instructor choose to cover a specific topic in more detail. Other than that, it will be professionally bound, and cost less than the workbooks that were available from Apple. ^_^ Good news for any Apple Authorized Training Center.

The Test
now that I have taken both tests, I can say that the tests are written a little better than the previous test, though I took the longer version than will be available for everyone else. The test will be designed to have someone sit for 2 hours (mine was designed for someone to sit for 2.5 hours), and instead of killing all the easy questions, both easy and hard questions will be removed from the test. This way the test results will be generally higher, and passing will also need to be higher. For now, it will still be multiple choice, but they are looking into some real application and development along that front. What I would like to see is a practical sit-down test, similar to Red Hat's exams, which no one can just memorize an answer without learning something. Apple Training would like to see it as well, so it's good to see that we are on the same page. ^_^

The Staff
Apple Training has gone through a lot of changes recently, with most of the staff being laid off. This comes from a common belief that the Macintosh platform is so easy to use, there shouldn't need to be any training for it (i.e., the Apple Executives that don't want to pay for a Training Department). Unfortunately, this is the way many companies are moving, and leads us into a longer rant about the importance of training, and the quick decisions to axe training in corporate environments to save money. Anyway, those that are left are really the cream of the crop, and being led by someone that really has a fantastic vision for the direction training should go.

Final Thoughts
My trip to Austin was bumpy, my trip back was agitated. I had more bad experiences in Austin than I have had in just about any other city, but all in all I liked it. I'm actually making a plan to head down to San Antonio in a couple of years, as we plan a trip to Oklahoma to visit some family. So it wasn't the worst experience I have ever had in traveling (that would be the time I was in JFK and a baggage car rammed into our plane, delaying us 5 hours). All in all, it was productive, and this Spring we can start with the 10.5 materials. In the meantime, I am going to see if it's possible to set up a testing environment for the Macintosh that will let me grade someone on the progress they have setting up a machine, both at the Computer and Server level.

December 17, 2007

Dennis Muhlestein
nonic
All My Brain
» 9 Essential Principles for Good Web Design

I came across this article on Digg.com. It contains pretty concise tips that I can follow and make sure I’m doing. Since I’m not a designer and don’t necessarily have the best ability to choose matching colors and appropriate fonts etc, I find articles like these helpful to bookmark for reference when tuning [...]