Talking Tech: Bullets on Slides

Posted by Dave Bouwman | Posted in Talking Tech | Posted on 22-01-2009

2

On the topic of bullets, the advice is pretty simple: Don’t Use Bullets. Bullets are a crutch in PowerPoint – they are always there in the standard templates, and when you start adding text, shazam! there they are. And once you’ve got them in the slide, they usually don’t get removed. To summarize: bullets are one of the easiest ways to create “yet another awful PowerPoint”.

Not convinced? Let’s think about a few things…

1) People can read text faster than they can speak the same words.

The effect of this is that if you show a slide with 6 points on it, the audience has read all of them before you’ve finished explaining your first point. And, while they were reading, they were not listening to what you are saying. They disconnected. Once they disconnect, it takes some effort for them to re-connect to what you are saying, and re-orient themselves in the flow of the presentation. If your slide deck is all bullets, this disconnect / re-connect loop gets very tiring, and people check-out, check their BlackBerry’s, fire off a few tweets or just fall asleep. When that happens, you are simply wasting your time and theirs.

2) Bullets are the “discount” summary of what you are going to say.

In addition to the fact that the audience gets ahead of you, and gets disconnected, they are also only getting part of the story. Ideas are usually much more expansive than what can be crammed into 7 words in 30 point font with a bullet in front. The bullet is the “discount” version of your idea. Since every presentation is about marketing (yourself, your idea, your product, your slide-technique, your tie) you want the audience to get the full story about why you think your thing/service/design/tie is great, and why they should too. (Note: If you don’t really believe in what you are talking about, don’t present it. More on this in another post.)

So – hopefully that’s got you thinking outside the bullet box. But what if you actually need to show a list?

One option is to show a REAL list…

image

I’ve re-used this image in a number of slide decks, just changing the text to fit the scenario.

 

Another option is to use a series of images. Maybe the original slide looks like this…

image

It could be changed into a rapid-fire series of images…

image

which has a lot more impact to the users, and keeps them engaged.

I looked through well one of our “Agile 101″ decks that has more than 350 slides explaining the both the zen and process of implementing Agile practices, and this was as close to a “bullet list” as I got:

image

The first slide gives the visual that we are talking about a meeting, and the second lists the key things we address at a “Sprint Planning” meeting. Sure it’s a list, but no bullets were involved and given the other 349 non-listish slides, no audience members fell asleep.

Bottom line:

You can usually avoid bullets, and if you want to keep the audience engaged, you should.

ESRI Javascript Starter Kit…

Posted by Dave Bouwman | Posted in ArcGIS Server, Dojo, Javascript | Posted on 16-01-2009

5

The Javascript starter kit has been released, and I have to say it’s pretty sweet. We have been working with some pre-release versions and I wanted to give a shout out to the main developers of the kit – Simon Biickert, Chris Macleod and Rachel O’Neil, all of ESRI Canada. As it stands the kit is a really slick starting point for a map-centric client side application. That said, if you want to extend it, you will need to get your Dojo kung-fu on. Now that it’s out we’ll start posting more examples on how to create/extend these widgets.

Speaking of extending, we have expanded on the kit so it supports some extra services as well as pulling the entire configuration from a service, based on a user’s identity.

Thus far we’ve used this for two map-centric web apps.

The first is for a “City GIS Services” group and basically allows public users to locate public records information and print maps. This site is nearly live – we are just polishing up the UI and building out the tile caches. I’ll post about it when it’s up and on the city’s servers so people can poke it.

image

 

The second is an emergency operations center dash-board application that is still in active development. This will have some interesting event management tools and a catalog of layers that can be added into the map as well

image

Both sites use a combination of the ArcGIS Server REST API, and custom json services. They are also both built on the ASP.NET MVC framework.

Agile Code Evolution: Fake it till you Need It

Posted by Dave Bouwman | Posted in ASP.NET MVC, Agile, Fundamentals, Unit Testing | Posted on 14-01-2009

0

As a project grows, there are certain areas of the code-base that becomes brittle – that is, they become real hassle to change. But, in an Agile process, we need to be able to evolve any area of the code at any time, with (hopefully) minimal impact. How can we do this?

One technique we’ve adopted on recent projects could be called “Fake it till you Make it”, or “Fake Injected Repository Test-Driven-Development”. Whatever the name, it’s working pretty well.

The main brittle point we are trying to overcome is the persistence layer. Even with a Repository pattern to hide the details of persistence from the domain, subtle changes in the domain classes can lead to time consuming changes in the persistence code, mainly in the mapping between the database and the domain classes. To make things more complex, our project already has a large database with tens of thousand of records. While we can make changes to the schema, we also need to write data migration code that moves data from the current schema to any new schema. So, changes to the domain can have wide reaching effects.

Since our code evolves sprint to sprint, we can have some large scale changes in our domain model on a very regular basis. We wanted to wait until the last possible moment before we actually “committed” to a database design, and an actual implementation of the data persistence layer (not to mention, changing the data migration scripts)

Our Solution (Short Version)

The solution we have come to is to “fake” the repository until we are satisfied with the design & behavior of the domain layer, and THEN update the data migration scripts, and THEN create the real implementation of the repository. This allows us to refactor, rename, and generally go hog-wild with the domain classes, streamlining things as we discover how the application actually wants to work with them, before touching the database and the ETL code.

That’s the quick summary. The rest of the post looks at how we are implementing this. I’m working with ASP.NET MVC, so that’s the context, and any reference to a “Controller” is in that context, not a “data controller” which are common in other data access models.

Interfaces and Dependency Injection

As I mentioned, we use interface based repositories to separate the persistence details from our application code (the “domain” if you will).

image

This separation give us a lot of good things, not the least of which is the ability to mock the repositories in our unit tests (because we use interfaces). But before we get to that, we have the issue of getting the repository into our domain, and for that we use dependency injection.

For those not familiar with it, just think about it is as a fancy name for passing required external dependencies to a class by it’s constructor.

So – for example, in our MVC applications, our controllers orchestrate the actions with the domain, and thus they require access to the repository. So, the constructors for our controllers take various repositories…

/// <summary>
/// Initializes a new instance of the <see cref="LoginController"/> class.
/// </summary>
/// <param name="authenticator">The authenticator.</param>
public LoginController(IAccountRepository accountRepository)
{
      _accountRepository = accountRepository;
}

So, in this code, our LoginController class requires an IAccountRepository. We use Castle Windsor and some MVCContrib classes to wire this all up, but that’s for another post. The main thing here is that we are passing in the data repository as an interface.

The Interface

At this point, our interface is still pretty lean – we only add what we need in the code at any time. This is following with the Test-Driven and Agile ideals of building just what you need when you need it. Thus we don’t have all sorts of other GetAccountBy… methods on the interface. Also, we have not gotten to the point of updating Users, so you won’t see any UpdateUser methods either.

/// <summary>
/// Interface defining all interactions with Use Accounts
/// </summary>
public interface IAccountRepository
{
    /// <summary>
    /// Authorizes the user.
    /// </summary>
    /// <param name="username">The username.</param>
    /// <param name="password">The password.</param>
    /// <returns></returns>
    User AuthorizeUser(string username, string password);

    /// <summary>
    /// Gets the menus that this user has access to
    /// </summary>
    /// <param name="user"></param>
    /// <param name="baseUrl"></param>
    /// <returns></returns>
    IList<MenuItem> GetMenusForUser(Customer user, string baseUrl);

    /// <summary>
    /// Gets the customer by id performing a deep load of all contained collections.
    /// </summary>
    /// <param name="customerId">The customer id.</param>
    /// <returns></returns>
    User GetCustomerById(int customerId);

}

Faking It

During the sprints in which we need to mix up the domain classes, we will run with “Fake” implementations of the repositories. Quite simply, a “Fake” is a real implementation of an interface, but instead of returning real data, or running real functions, it returns canned “fake” data. This is really handy because it’s very easy to update the FakeRepository – after all, it’s just code – no database tables, stored procs, primary keys, or migration code to mess with.

 image

During this phase, we focus our efforts on driving the design of the domain with unit tests and UI integration. Since the FakeRepository get’s injected into the application just like a real one would, we can actually run the application. This allows us get feedback from clients, before investing time in building out the persistence tier. This is a huge time savings and allows us to prototype things faster and easier than before.

Of note, we still use Mock’s of the Repositories in our Domain unit tests, so we are cleanly separated from our Fakes. We do this so that our tests will continue to run regardless of changes to the “fake” data which may be returned from the FakeRepositories.

     /// <summary>
     /// Authorizes the user.
     /// </summary>
     /// <param name="username">The username.</param>
     /// <param name="password">The password.</param>
     /// <returns></returns>
      public Customer AuthorizeUser(string username, string password)
      {

          //Create organizations
          IList<Organization> orgs = new List<Organization>();
          orgs.Add(new Organization("DTS", "DTS"));
          orgs.Add(new Organization("Dev", "DEV"));
          IList<Role> roles = new List<Role>();

          User user = null;
          switch (username)
          {
              case "admin@edats.com":
                  roles.Add(new Role(RoleEnum.ApplicationAdministrator));
                  roles.Add(new Role(RoleEnum.Researcher));
                  break;

              case "agency@edats.com":
                  roles.Add(new Role(RoleEnum.AgencyReviewer));
                  break;

              case "user@edats.com":
                  roles.Add(new Role(RoleEnum.Researcher));
                  break;
              default:
                  return null;
          }

          user = new User(null, "deFaker", "Luke", "Luke deFaker", roles,orgs);
          user.UserId = 1;

          return user;
      }

In this code above, we have some simple logic that will let us log into the site as 3 different users, who have different sets of roles in the system. It’s all fake, but it it allows us to build out the application and more of the domain classes.

Needing It

Once we are at a point in a sprint that the domain is stable, we then push the changes back into the real repository implementation, and change our data migration scripts. Since we know the interface, we can do this work very test-driven, which leads to very lean data access layer code. We know exactly the methods that the Domain requires, so that’s all we implement.

image

In this system, we are using SubSonic in the implementation of the Repository. The code below shows some of the implementation (you can read more of this over at Brian Noyle’s blog)

        /// <summary>
        /// Authorizes the user.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <returns></returns>
        public User AuthorizeUser(string username, string password)
        {
            //this method just returns a shallow user with roles
            Domain.user result = null;

            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                return result;
            }

            //get the user using subsonic query
            result = RepositoryUtility.BuildPocoTypeFromRepoType<Domain.User>(DB.Select().                        From<User>().
                        Where(User.UsernameColumn).IsEqualTo(username).
                        And(User.User_PasswordColumn).IsEqualTo(password).
                        And(User.IsActiveColumn).IsEqualTo(true).
                        ExecuteSingle<User>(), true);

            if (result != null)
            {
                result.Roles = GetRolesForUser(result.UserId);
            }

            return result;
        }

Summary

Thus far, this has been working pretty smoothly. We get the flexibility when we need it, and don’t have a lot of un-necessary churn on the data access tier. We can switch between the fakes and the real Repositories by just changing a few lines in our Global.asax file. Simple. Sane and Highly Testable – everything we are looking for. Will it skin your cat? I can’t say, but the general idea can likely be applied.

Talking Tech: Presentation Predictions for 2009 (Links)

Posted by Dave Bouwman | Posted in Talking Tech | Posted on 13-01-2009

0

Over the last few days/weeks there have been a number of good posts out the the “presentation” space. Thought I’d add them to this series:

Olivia Mitchel: PowerPoint Design in 2009: Does Design Matter?

Burt Decker: PowerPoint Revolution in 2009

Nancy Duarte: 5 Predictions for Presentations in 2009

Nancy Duarte: 10 Commandments of Storytelling

Scott Schwertly: Presentation Design in 2009

Andrew Dlugan: PowerPoint Design Wish List

Talking Tech: Slide Templates

Posted by Dave Bouwman | Posted in Talking Tech | Posted on 13-01-2009

0

This is the second in a long series of posts about technical presentations. You can see the whole series by clicking on “Talking Tech” in the tag cloud on right.

Kill Your Templates

Ok, you don’t have to delete them, but just don’t use them. Sure, someone may give you greif about not having the company logo on each and every slide, but trust me, after they see your presentation, this whining will stop. Our goal is to have people remember what you are saying, and by not giving the same old presentation, people will actually take notice, pay attention, and may actually remember what you’ve said.

Slides are there to support you – to support your point. There is no need to have your logo, phone number, name, date, slide number or anything not related to what you are saying at that moment on the slide.

Create a new Template

Didn’t I just say templates are evil? Yep. But we are going to make a “less evil” template. Actually this is more about psychology and how humans view things. It’s the “rule of thirds” template. The basic idea here is that a scene / graphic is more visually interesting if the main elements are not slam bang in the center. By creating a template that has guides setup to divide the slide into thirds, you’ve got some help getting this alignment correct.

 image

See – not too “templatey”, but the guides help align elements in a visually pleasing way.

Text Styles

This is where things start to really diverge from the usual presentation style. I recommend killing all the text formatting. Just delete the text areas on the master slides. We are not building sliduments here, so this is not a big deal. The only the most critical text will be on the slides, and we will be putting that in manually.

Here’s an example

image 

This is part of a rapid-fire section of a talk, but as you can see the text was not slapped into a template.

Download the “Thirds” templates for 2003 and 2007 (Keynote people, you’ll have to work this one out yourselves)

2009: Year of Hybrid GeoWeb Applications?

Posted by Dave Bouwman | Posted in ArcGIS Devt, GeoWeb | Posted on 12-01-2009

3

In the past, many clients would specify “all ESRI/COTS” (Commercial Off The Shelf) solutions, and were not particularly interested in intermingling open-source components. However, I believe the current financial down-turn may make hybrid solutions the pragmatic choice. Many organizations who may have been leery of brining in PostGres/PostGIS, may now be open to the idea because budgets are frozen and there is simply no way they will get funding for another Internet connected COTS DBMS license (which runs $5,000 per CPU for SQL Server).

Organizations who already have ArcGIS Server licenses, may be inclined to “save” the ArcGIS Server system for heavy-lifting spatial operations, and use GeoServer or MapServer for creating dynamic map layers/tile caches, and custom services for things in-between (i.e. mark-up type editing or spatial based reporting). Since ESRI now supports maintaining data in a native spatial format on all the major databases (with “SDE” in the mix), it’s now viable to use the ESRI desktop tools for daily spatial data management, while also building out a mixed environment for servicing GeoWeb applications.

The following diagram shows a very generic architecture that I think will become much more common over the next year.

Hybrid-solutions

This approach leverages the best features of all the software packages, while also optimizing the use of expensive, CPU-bound licenses.

How hybrid is your system? What’s holding you back?

Talking Tech: Know thy Audience

Posted by Dave Bouwman | Posted in Talking Tech | Posted on 09-01-2009

4

This is the first in a what will likely be a long series of posts on how to give a technical presentation. Everyone has sat through their share of horrid presentations, and it’s easy to throw stones, but what happens when you’re called on to be the one talking? Hopefully these posts will help…

Audience

This sounds obvious, but you’d be surprised how often people skip this step. Here’s the key idea: The audience does not care about you. They care about themselves. So you have to speak to them in language that’s relevant to them.

What does that mean? Here are some examples…

If you are presenting to…

Other Techies:

These folks speak your language, they are your tribe, and they will likely groove with seeing code. You’ll be able to show off the “cool” parts of things – like how and why you extended jQuery. If you are new to presenting, this the audience to start with. A good place to get practice talking to other techies is at user groups. Many organizations have regular brown-bag lunch presentations to spread technical knowledge around the group – get up and talk!

Senior Executives:

These folks are very different animals. Focus on financial benefits, cost savings, market advantages etc. They do not speak techie, and don’t care about lamba’s or reflection. Skip the details of how you’ve extended jQuery. Performance is maybe worth mentioning, but make it comparative to something they know. Use buzzwords, but don’t get into the weeds – i.e. “It’s an Ajax enabled site”.

Marketing:

Similar to the executives, while these people understand your business, they tend to have a very different view than you. Buzzwords are good, technical details are bad. Focus on how you can help them sell/brand/expand market share, as that’s what they care about.  Start of with “How to Take Over the World”, and you’ll hit about the right tone.

The Public:

These are some of the hardest presentations to give. You need to hook them early, and keep them interested. It’s ALL about them, and they likely have no idea who you are, or why they should care. A kick-ass slide deck will help here, but it will only get you so far. I’d avoid talking to the general public until you are pretty comfortable talking to

Children:

Perhaps the hardest group of all. With attention spans in the minutes, and a completely different world view, this will keep you hopping. Again, keep things relevant to their experiences. Use Elmo in your slides, and have something real they can interact with – such as a globe if you are talking about GIS.

2009: Embracing Change…

Posted by Dave Bouwman | Posted in careers | Posted on 09-01-2009

4

1084478_barometer_1 With the global economy in shambles, the old-guard of industry on the rocks (Wall Street financial giants, Detroit Automakers, and all manner of “industry-leaders” in-between) and a new president taking office in a few weeks, the one thing you can say about the upcoming year is that things will change. Big time.

What’s interesting is that with this change, there will be lots of opportunities. Enterprising companies and individuals will jump into the fray, with innovative ideas and succeed. However, some sectors of our economy have gotten fat, happy, and stupid. Somehow “status quo” became a management goal in many tech companies. Marketing got shy and wanted to “protect the brand” rather than be remarkable. Middle Mangers have been trained to  “Manage Growth”, which is really just code for “let’s keep doing the same thing, but do it cheaper so we get more market share”. Senior managers have focused on short term profits while paying lip service innovation – it’s always slated for “Next Quarter”.

At some level, these groups honestly expected to remain leaders simply because they were leaders. They drank their own Kool-Aid. Just like the mortgage industry, “of course house prices will continue to go up”, and everyone knows how well that worked out.

Unfortunately, in exponential times, when competition and innovation comes form all corners of the world, this sort of complacently/incompetence will bite you in the ass. The economic downturn has simply increased the pace of change. The truth is that big companies don’t deserve to “live forever” anymore than new start ups. Innovation and flexibility are the key ingredients in times like these. If you are not being remarkable, then what are you? Following?

For companies that have been running lean, innovating, and “embracing change” as a way of doing business, things are really exciting. What’s better than having major competitors pushed out of a marketplace, basically by their own hubris?   By fighting for the status quo and stifling innovation for so long,  they are unable to make the huge evolutionary leaps needed to remain competitive. Cutting prices to rock-bottom levels may keep some business coming in the door, but how long can that last? Does the company really have enough cash reserves to ride out this downturn while taking losses on every transaction? (Think big-box electronics stores here). And suppose they do make it through, can they then raise the prices? How will their customers react to that? Right. Like it or not, the writing is on the wall, and it’s not good news. If you are not on the cutting edge, delivering remarkable products and services, embracing new media, and interacting with your customers, the next year or so is going to be really rough.

Getting Out

What if you happen to be in one of these organizations? You may want to start planning for a new future. Seth Godin and Guy Kawasaki have lots of ideas on how to breed innovation within yourself and within organizations. Once you know what you want to do, get out there and become the change we actually need.

Thoughts? What would you suggest to those in “less-than-leading” organizations?

Best Line of Code Ever…

Posted by Dave Bouwman | Posted in Agile, Fundamentals | Posted on 07-01-2009

3

…is the one that’s never written. Think about it – cost-wise it’s awesome – no time was spent writing it, documenting it, or testing it. It’s performance is also outstanding – it takes zero CPU cycles! And maintenance-wise it’s great – no concerns that it’s going to be a problem when making changes in your application. Best. Line. Evar.

As developers, we all like to write code – I’d go as far as saying that I love writing code, and if you follow me on Twitter, you’ll see stuff like this pretty frequently…

image 

Add to this that we tend to be forward thinkers, and the result is that we add in little “extras” here and there – especially if it’s “interesting”. Of course it’s all done with the best of intentions, idea being that “maybe we’ll need this…”. As a system grows, this “extra” code is littered all over your application.

But, sometimes this code actually adds more complexity to the application. It can make API’s more confusing, and make refactoring more difficult. Concerns get muddled, and object models get cluttered. This all ends up wasting lots of time as others try to figure out how to work with your classes and keep the system stable.

Jamis Buck of 37Signals calls this “future creep”, which is a great way of looking at it. As developers we all loath feature creep, but have a tendency to add our own future creep into the process.

Write the Right Code

The solution sounds so obvious, but it’s worth repeating. Make sure that you are writing the right code. And the right code is “just what you need now”. Don’t add anything for “what-if’s” or “maybe-when’s”. XP will yell “YAGNI” – You Ain’t Gonna Need It – at any “extras”, and most of the time they are right. You don’t need it. Thus, the best code is the code you did not write.

Code Coverage: What’s Enough?

Posted by Dave Bouwman | Posted in Uncategorized | Posted on 06-01-2009

4

I’ve been happily coding along on an ASP.NET MVC project using Test Driven Development (TDD). When you write the test first, you usually end up with very high code coverage numbers…

image

(Obviously the LoginController was not written TDD – creating tests for it is next on my list!)

Anyhow – I’m currently working on the SecurityHelper – which does some rather ugly User.Roles to Workflow-Status comparisons to determine if a user can View/Edit fields on the Project domain object. Since this is really the core of this system’s security model, I really wanted this to have high coverage. With TDD I should have 100% right? What’s with that 99%

Digging into NCoverExplorer, we can see the coverage by method…

image

So – my problem is the GetEditAccess method. When we dig in further, we can see the actual code that’s not executed during the test run… (how awesome is NCoverExplorer!)

image

This is the default clause in a switch/case block that is switching on an enumeration. I even noted that this code would only be hit if someone added a value to the enum, re-compiled the app and passed that into the method. And, should this occur, I want to ensure that security is not compromised.

So -  the question becomes – if I can’t* write a test to exercise this code, should it be there? Rigorous TDD would say no, but having guard clauses is a good idea – especially a default in a switch/case.

Personally, I’m leaving the guard clause in there and I’ll just have to live with 99% coverage for this class, but it’s something to think about – what amount of coverage is enough? What is too much?

For this project, we have used code-generation to create some “domain object” starting points (we can’t do pure Domain Driven design here because we have inherited a populated database). At this point in the project, we’ve got about 30 of these domain classes, which are dominantly just properties. Since we “trust” the .NET CLR to do it’s job and correctly handle the getters and setters, we are not spending time with testing that code. When we add logic to these classes, we add tests, and we expect high-coverage on them.

What’s  your take on Code Coverage? Worth it or waste of time?

*[Ok, you could likely do something with Reflection, but that would waste a few hours figuring out how to do it - does not see like very efficient way to spend time.]