Archive for July, 2009

From the PM Trenches

Wednesday, July 22nd, 2009

Do people still write from trenches?  Are there even trenches large enough to write from?

Anyway, something I wrote for my project management class today…more of a brain-drain than anything else…

A Systems View of Project Management…

Taking a systems view of a project requires looking at not only the project’s specific requirements and proposed technical solutions, but also taking a broader view of the organizational and business impact of the project in the company or community in which the project is being delivered.

Before a project even begins, and through out execution, all of the stakeholders should look more holistically at the project and how it will impact and be impacted by the rest of the business and organization.

I am currently participating in a project where the sponsor only considered the business impact (and benefit) of his proposal, without considering the organizational or technical implications. The sponsor proposed building a new web site to attract more customers to our web service, and connecting it to two additional web sites to form a simpler way to complete contract management activities.

Unfortunately, our sponsor did not consult with the owners of any of these systems, and did not understand the impact to his project when our company reduced the support and development staff for all three groups. We have worked hard to incorporate the organizational impact on his timeline, so he can more realistically plan his project.

Additionally, our sponsor made some inaccurate assumptions about the capabilities of each system, and over-committed his project to more than we were capable of delivering. After several discussions, I was able to clarify the most difficult technical hurdles for his project, so he could understand and modify his proposal.

While I am not the sole project manager for his project, I manage one of the web sites at its center. When I investigated his proposal for an external system to pull information from our web site, I realized the amount of effort to integrate both systems so closely, would far outweigh the business benefit. I could have told him he was asking for too much, and it would take months to complete what he proposed. However, I convinced him that by removing just one of his four proposed features, he would get as much business benefit, with 25% of the effort. He agreed and we modified the project today, much to everyone’s satisfaction.

It’s much easier to view a project with just a technology, organization or business view. Many web developers I know (myself included, earlier in my career) fall into the trap of doing whatever the customer requests, without regard for the future of the application, or the long term vision of the company.

However, when I broaden my approach a little, i find that many very thorny technical problems can be solved quite easily (often better) without writing a line of code.

I believe the biggest disadvantage of using a systems approach comes when many people have different views of the systems as a whole. Projects can become more complicated and even paralyzed if stakeholders get too involved in making sure everyone in the organization is happy. At some point, people do need to get down to business and just move forward, accepting that there will always be some forgotten organizational or business implications.

Trouble with Lowpro and Prototype

Monday, July 13th, 2009

If you use Lowpro’s extensions for Prototype, you might run into this issue with Internet Explorer 7 (if not 6).

I use LowPro for its nifty shortcuts to otherwise daunting syntax for adding behaviors and page-level events to a web page.  Conventions like Event.addBehavior and Event.

Recently, perhaps with the newest version of Prototype, I started encountering problems using the class name selector in Prototype ($$), and with Event.addBehavior.  In IE7, this manifested itself with “Object doe s not support this property or method” errors around those blocks.

Temporarily, I replaced $$ with $(“id”).select(“.class”), which solved the problems with $$.  Event.addBehavior seemed more quirky, and I really didn’t want to relinquish that nice little command.

Lo and behold, I found on the LowPro web site, a command to disable LowPro’s $$ method.  If you have similar problems with LowPro, insert this statement after your call to LowPro, and you’ll be able to use $$ and Event.addBehavior with wild abandon:

LowPro.optimize$$ = false;

HowTo: Add a jiffy table of contents to a page

Sunday, July 12th, 2009

When I built this version (the umpteenth) of my personal web site, I wanted to use a few more tricks I’d learned in the past few years, and thought it would be nice to make them do some of the work for me.

If you’ve seen my resume page, you might have noticed the table of contents in the upper right corner.  It’s supposed to help the intrepid wanderer jump to different spots within the page, without having to read the whole darned thing.  (ed. Yes, my resume is long, and yes, I really should do something about that).

Anyhoo…I wanted a Table of Contents, but I didn’t want to have to update it every time I changed my resume.  Ok, I don’t change my resume that often, but bear with me here.

Table of Contents - screenshot

Well, along came Prototype and Scriptaculous.  If you haven’t heard of these, they are both JavaScript “libraries”, or collections of functions and utilities, maintained by a particular community or group, which provide certain higher-level capabilities than if you just wrote JavaScript, yourself.  jQuery is another such library, and between Prototype and jQuery, I still lean toward the former.  jQuery has a more modular architecture, and a tidier core syntax.  However, I have found its extensions lacking in a lot of areas, whereas Scriptaculous, etc, seem to be more flexible.  Maybe I haven’t done enough with jQuery, who knows…

A word about using JavaScript to manipulate a page:  I tend to do this sort of thing only when the content I’m adding is not absolutely critical to the content.  The core page functions and content should always be built right into the HTML, primarily so people who don’t use JavaScript can still read your page, but also, so search engines can still find and read your content.  JavaScript is great for adding little utilities to enhance the user experience, but should rarely be the entire experience.  (I’ve violated this rule a number of times before, usually for expediency, but it ALWAYS hinders the UE, even if it’s just for Safari users =]).

As it happens, one of the neatest things about Prototype (and jQuery, for that matter), is that it’s really easy to look into a page, using JavaScript, move things around, add stuff, remove stuff, and manipulate the page, without having to constantly rewrite your HTML whenever you want to change something.

To make a long-ish post relatively short(er), let me just paste the code that builds my table of contents, and if you’d like to know more, feel free to ask…sound good to you?  Good, here ’tis:

TOC JavaScript:

  <script type="text/javascript" src="scripts/prototype.js"></script>
  <script type="text/javascript" src="scripts/scriptaculous.js?load=effects,controls"></script>
  <script type="text/javascript" src="scripts/lowpro.packed.js"></script>
  <script type="text/javascript">
    TOC = {
      show: function() {
        $("resume").select(".sect").each(function(header) {
            var totop = new Element("a", {href: "#", className: "helper"}).update("[Return to Top]");
            var url = "#"+header.id.split("_")[1];
            var title = "";
            if (header.match('h3')) {
                title = "<strong>"+header.innerHTML+"</strong>";
                header.insert(totop);
            } else {
                title = new Element("div", {className: "indent"}).update(header.innerHTML);
            }
            var entry = new Element("a", {href: url}).update(title);
            $("toc").insert(entry);
        });
      }
    };

  Event.onReady( Toc.show );
</script>

HTML:

<div id="toc"></div>
<div id="resume">
  <h3 class="sect">Summary</h3>
  <p>Twas brillig, and the slithy toves.
  <h4 class="sect">Skills</h4>
  <p>Did gyre and gimbal in the wabe.
  <h3 class="sect">Jabber</h3>
  <p>All mimsy were the borogoves.
  <h4 class="sect">Wock</h4>
  <p>And the mome wraiths outgrabe.
</div>

Walkthrough:

If you’re curious, here’s how the above works:

Event.onReady( Toc.show ); The TOC starts building with the Event.onReady at the bottom of the script. Event.onReady is a shortcut command from Lowpro, which waits until the page loads, then runs the “show” command from the “TOC” JavaScript class. The equivalent (mostly) in Prototype is

Event.observe(window, "load", function() {});
$(“resume”).select(“.sect”).each(function(header) { This command grabs all of the page elements using the CSS class “sect” from the larger container element with the HTML ID called “resume”. Once it has all of these elements, it puts them in an array, and passes the whole bunch to a function to do something with them. The “header” variable holds each one of these array items so the function has something to talk about.
var totop… This variable (totop) creates a hyperlink that will jump to the top of the page
var url… This variable creates a new URL using the ID from the element represented by “header”, and prefixes it with a pound (#) symbol.
if (header.match(‘h3′)) {} else {} This if/else block constructs a link with a certain format, depending whether the “sect” element is a H3 tag or an H4 tag. H3 tags will be displayed in bold and flush left, while H4 tags will be normal weight and indented slightly
var entry = new Element(“a”, {href: url}).update(title); This line just creates a new hyperlink (“a” tag) using the URL and Title generated above. On the page, nothing has actually happened yet
$(“toc”).insert(entry); Ahah! There’s a special DIV tag on the page, with the ID called “TOC”. This line just plunks the above element into it.

Hopefully, you’ll find the above useful, somewhat informative, and if not, vaguely unusual. At any rate, let me know if you like it…or not =]