Craig Shoemaker
|
Craig Shoemaker
4 Elements of Professional WPF Applications
Listen to the Show!
Composite Application Guidance for WPF: Prism Goes Prime Time
The WPF answer to CAB is the Composite Application Guidance for WPF, formerly codename Prism.
NOTE:Since the full name is too formal, too long and I can’t with a straight face refer to a development platform as "CAG", we’ll just continue to refer to this technology herein by its code name: Prism. Cool? :)
In this podcast we speak with Brain Noyes of IDesign. Brian is not only an original advisor and consultant to the Patterns and Practices group for Prism, but he is also a prolific writer, an INETA member, Microsoft MVP, ASP Insider and Microsoft Regional Director for the Mid-Atlantic region. With a guy as decorated as Brian, you’d think he was in the military!
What is Prism?
Prism is a set of guidance from the Patterns and Practices group that aids in building composite WPF applications. To be clear though:
- Prism is not a new application block
- Prism is not a new framework
- Prism is not a new software factory (Prism does not feature automation)
Well now that we’ve gotten that out of the way, what is Prism?
Prism is:
- A set of libraries - named the Composite Application Library or CAL
- Patterns, documentation and sample code
- A reference application which mimics a real-world line-of-business application
- A series of quick starts that demonstrate Prism’s discrete features
What is a composite application?
Large applications whose user interface layer is not modularized end up with a monolithic code base that becomes very difficult to extend and maintain. Without breaking apart the user interface layer maintenance is hampered and working with large or distributed development teams proves difficult.
Often in WPF developers try to modularize by breaking the UI into user controls. Unfortunately, user controls end up needing intimate knowledge of each other so the maintenance problem is displaced rather than assuaged.
A composite application (in the UI sense) breaks the user interface into smaller, independent pieces where testing and development proceed in isolation.
Where Did Prism Come From?
The Patterns and Practices group did something very different before coding began for Prism. Rather than host early looks inside what the group had cooking under the covers, the team at Microsoft reached out to several industry professionals asking them, "What do you want us to build?" After digesting the feedback the team started first by building a real-world application – using the program to drive the development of the guidance.
Further back on the timeline, many of the techniques found in the Prism guidance came from the lessons learned and techniques that emerged from building the first large-scale WPF application, Expression Blend. Blend not only demonstrates what is possible in WPF, but also proves the hypothesis that a substantial application can be built using a composable user interface.
What Are the Basic Elements of Prism?
The four natural breaking points of Prism are:
- Modularity*: A class library with single provides the lone
entry point for a feature. Modules act as logical wrappers for portions of your
application.
Prism features module enumerators for creating and locating modules at run-time, and a module loader which instantiates modules for the application. - Regions: In the same way that ASP.NE T master pages host
content placeholders, a Prism region is a placeholder for modules. This approach gives the application the
flexibility it needs to load in the appropriate features and associated UI
elements as needed.
- Composite Commands: Extends WPF routed commands to be loosely-coupled
from the visual tree and dispatch commands to multiple handlers.
- Loosely Coupled Events*: This new eventing mechanism features:
- The definition of
the publisher and subscriber to exist at any layer of the application
- Type and lifetime decoupling between
the publisher and subscriber, but with a strongly-typed communication model
- One line of code on the sender and receiver side
- Dispatch threads on the UI thread, publisher’s thread or a thread from the
pool
- Provide filter criteria using lambdas or delegate methods to decide whether
or not to notify the subscriber when the publisher’s event fires
- The definition of
the publisher and subscriber to exist at any layer of the application
* The modularity and eventing mechanisms are independent of WPF and may be used to support other UI technologies.
What About Performance?
Any layer of abstraction will affect performance. Load testing revealed the performance impact is realized upon instantiation of the forms. Using dependency injection (which relies heavily on reflection) increased the load time a measurable amount. When testing a form with hundreds of controls the test reported a 15% to 20% in load time. While this latency is not trivial, there are ways to improve the user experience in light of the extra load time. The built-in modular loading supports deferred and on-demand loading.
NOTE: Remember the 20% increase was on a form with 100's of controls. If you are building screens with over a hundred controls on them, perhaps the load time is the least of your worries?
How Does Prism Serve the Developer/Designer Workflow?
The patterns found in the Prism guidance truly separate the natural layers of the application by even aiming to have zero code in the code-behind! The presentation layer is decoupled for testing, but has the added benefit of being able to easily hand to a designer.
How Steep is the Learning Curve?
Some developers are facing an uphill battle when approaching Prism. If you are new to test driven development, the principals of separation-of-concerns, dependency injection and any other cool-kid buzzword that radiates from the ALT.NET movement, then Prism may seem like a huge undertaking.
If you do have exposure to the ALT.NET culture then you are most likely beginning to fold these practices into your development regimen already.
Resources
- Composite WPF on CodePlex: Download the bits and the guidance
- Composite WPF Contrib on CodePlex: This open source contrib effort
will soon feature examples of how to use the eventing mechanism and modular
loading features in a windows forms application written by Brian.
- Design Patterns: The classic volume on object-oriented design patterns
- Head First Design Patterns: Get the same content as the above book, but delivered in an irreverent, less academic format
New ASP.NET Generated Image Control
The ASP.NET team released a new generated image control on to Codeplex today. You can download the bits here and read a very simple explanation of the control here.
The concept is simple: a handler that takes in a few parameters will render out an image. The control does what you would expect by instantiating the appropriate objects out of System.Drawing and renders the image to the screen. This handler may or may not be called by a generated image control in your ASPX markup, making it easy to implement into your HTML.
Using this control you’ll be able to render simple text as well as complex geometries and even graphs and charts.
Finding Chinks in the Armor
My first thought was to see how the control deals with transparency. While you can set the background color to transparent, I had a hard time getting text to look good with a transparent background. In image editing packages you can set a "matte" color which will step between transparency and the color of the text to preserve anti aliasing.I wasn't able to find a way to set a matte color. NOTE: There is the all-too-likely chance though that I missed something, so if you can point me in the right direction on this, please leave a comment.
Where’s the Evil?
Purists will undoubtedly criticize the use of this control to simply render text. Some say that you should never use an image to render text. While there is an excellent point in this position I think it’s important not to go overboard. There is nothing stopping you from by-passing the generated image control and accessing the handler directly to render the image. Using this approach you can simply define a background image in your style sheet and still render the appropriate text in HTML. (You can find many examples of this technique here)
Score on Day One
All in all I think they did a good job of making a control that is easy to use. In the future I would like to know more about how the handler deals with caching, effects performance and if there are any associated gotchas… but hey they just released it today, right? :)
If you are looking for a package to handle charts and graphs you may want to check out the NetAdvantage WebChart... I'm just sayin' ;)

Today I get to spend the day with my best friend to celebrate our first decade of marriage together. My hope is that you get a chance to spend your life with someone as amazing as my wife!
Hide Your Corporate Underpants - Using Personas in UX Design
Listen to the Show!
Tamara Adlin is a customer experience expert and President of Adlin, Inc. Tamara is formerly a Senior Usability Specialist for Amazon.com and is currently a blogger, author, trainer and speaker specializing in using personas in user experience design. Make sure to check out Tamara's website, blog and interviews with user experience luminaries at UX Pioneers.
What Are Personas?
Wikipedia defines personas as:
Personas are fictitious characters that are created to represent the different user types within a targeted demographic that might use a site or product.
Tamara’s Cheat Sheet to Personas
- Personas are an organizational pattern language. Just as
software developers are use design patterns to unify communication while
constructing software, personas bring consistency and specificity to who really
is "the user". When done right personas drive out false assumptions and give
people throughout an organization a way to clearly define the people for whom
they designing their product or service.
- Personas help prioritize work. Some features may be more
popular to develop than others, but when you are asking if "Mary Jo" would
really use that feature teams can begin to recognize whether or not that advanced feature is necessary to meet business objectives.
- Personas de-personalize and de-politicize topics. Instead of
telling Data Head Dan that reporting isn’t important right now, you can say
that "Mary Jo" first needs to be able to use the system before you can spend
time crafting administrative reports.
- Personas provide a way to transcend "department speak".
Developers communicate different from management and marketing – well we all
know about marketing! Using personas allows everyone in the organization to
communicate about aspects of the product or service with specificity and
clarity.
- Personas require you to know where you are going. Before you
can bring your personas to life you must first know what the organization’s
goals are. Personas exist to serve the aspirations of the company - if you don’t know what the objectives are
then personas are useless.
- Personas need to be relevant to everyone. Once created if
the personas don’t make sense to entire groups of people then they are ignored.
Stop this problem before it happens my making sure everyone involved can
answer, "How will using this persona make my life easier?"
- Personas are not an exact science. Even if you don’t execute
flawlessly against your persona chances are you will have solved many people’s
problems just in trying.
- Build personas based on goals not categorization. Rather
than create persona identity based on a category (small business vs.
enterprise) craft personas based on the goals people have. Goal-based
development will transcend awkwardly design categories.
- Start small. Resist the temptation to make your first
attempt at using personas a widely publicized event. You only get one shot at a
first impression and it may take some time to learn to use them right.
- Personas tend not to die, but rather evolve. Just as rarely
to businesses remove offerings, personas will grow with the organization based
on the stated goals.
Adlinisms
Tamara’s work is peppered with colorful metaphors that help drive her points home. Here are a few we discuss in our interview:
- Corporate underpants - when your org chart shows up in the
primary navigation of your website
- Let them pee - give people what they really want and then
you'll find they are probably amenable to listen to whatever you want to
present
- Barnacle-based design - piecemeal additions to a good
product or website eventually creating large and less-valuable version what's indended
Software Developers and Their Illicit Brethren
Tamara notes that there are only two industries that call their customers "users". Read Nerd Nirvana’s post on Software Developers vs. Drug Dealers.
Books Mentioned in the Show
![]()
The Persona Lifecycle : Keeping People in Mind Throughout Product Design
![]()
How to Win Friends and Influence People
Featured Music
Bed and bumper music in the show is provided by:
Installing .NET 3.5 and Visual Studio 2008 SP1 - My Gotchas
I just finished installing SP1 for .NET 3.5 and VS2008. I thought I would share the hoops I had to jump through in the event it saves you some time. Actually the process wasn't too painful. Be careful to remain patient during the install process though - the installers churned VERY SLOWLY on my machine, but eventually I had a successful install.
There were only a few "odd" things I had to do to get the install to work properly...
Our friends at Microsoft were very nice in providing a patch removal tool. This is much better than having a doc that you have to go step-by-step to get your maching the the appropriate state. Kudos to whoever's idea this was.
My only real issue was that the Patch Removal tool and the VS2008 installer kept complaining about Windows Explorer and the Machine Debug Manager being open. Since I started the install after a reboot with no programs open the Windows Explorer puzzled me for a while. It reported a process ID, but there was no match in Task Manager. In the end I realized that I had Dave's Quick Search bar running. After disabling this tool and stopping the Machine Debug Manager process (which restarted automatically after reboot) everything worked like a champ.
On the lists I am on I am hearing that some people run into needing the original media and others do not. I ended up needing to access the original Visual Studio install media. I work remote, so I had to work with my IS support people to get the media mounted and available on the VPN so I could access it. So I guess the moral of the story is to make sure you have access to the media one way or another before you begin.
Other than that, all went well!
Learning to Build on Rich UI Platforms
Listen to the Show!
Famed developer, speaker and author Billy Hollis joins the show today to discuss why developers need to avoid stagnation and keep pressing forward. Billy also shares some pragmatic wisdom of how to approach building on a rich UI platform.
Billy's Advice For Approaching WPF and Silverlight
- You need to know a significant amount WPF to be effective. Expect that you will flounder - the tools are a little immature, but you have to adjust the model of how you approach building applications.
- WinForms is still viable choice for new applications - just choose it for the right reasons. If you want to ensure a long shelf life - use WPF. Also if your application sets a high bar for UX consider WPF or Silverlight.
- Over the next 3 years the bar will raise for minimally accepted UX
- New patterns will emerge in conjunction with the new features of the rich UI platforms
- It’s easy to over-use features of a rich UI platform. Animation use animation sparingly and carefully.
- Blend can be a good starting point for developers who appreciate the advantages of code.
- Production application should adhere to DRY (don’t repeat yourself) principal. If you are not careful using Blend may lead to duplicate code.
Billy's New WPF Book
WPF Bootcamp
If you are looking to learn about WPF and the Infragistics WPF controls make sure to check out the WPF Bootcamp. Here is a list of upcoming sessions:
- Chicago – Aug 11-14
- Seattle – Sep 8-11
- Dallas Oct 6-9
- London Oct 27-30
- Atlanta Nov 2-6
- San Diego Dec 8-11
5 Ways to Know If Your Software Sucks
Listen to the Show!
David Platt is an author, speaker and developer who wants you to recognize that there is a problem in software interface design. Fear not - David is not alone. Computer World recently reported that "the majority of end users (60 percent) find enterprise applications somewhat difficult, very difficult or almost impossible to use, hampering employee productivity." Yes – there’s sucky software out there and it just might be in your source code repository!
Does Your Software Suck?
I am sure David may have 5 or 10 or perhaps 20 ways you can know if your software sucks, but the following are 5 ways I gleaned from our conversation:
- Did you design from the toolkit outward or the user inward? Perhaps you are a .NET or Ruby or Java wizard, but does your proficiency in these platforms punish end-users? There are dozens of features in any platform that if not managed carefully can result in frustrating user experiences.
- Are colors, motion and other visual elements used "just because"?
Designers like to design and coders like to code. Professionals are drawn to
their practice often because a sense of passion and desire for a creative outlet. This can be a problem though when software features bells and whistles where elegance and proactive design is more appropriate.
- Does the user have to memorize dozens of menu hierarchies or key commands? Balance is always a problem in user interface design. How do you accommodate newbies without frustrating the power-users? No one said there are easy answers, but with a little thought many features can become apparent at just the time of necessity.
- Do you use your final product to test out new design paradigms? This may seem silly, because people don’t think of what they do in these terms. Often a new feature is included a new build that passed QA and got the nod from the three other developers in the room – all to prove to be too confusing or simply out-of-place to end users.
- Do users have to think about using your program? When someone is using your software, if they spend a disproportionate amount of time thinking about how to use the software rather than the problem the software is hoping to solve – then your software sucks.
What Should We Do?
David’s advice is provocative. Instead of gunning off a list of do’s and don’ts David suggests the following remedy to sucky software:
- Allow software engineering to split off from computer science in formal education. Software engineering is much more than high performance algorithms and compiler design. Areas of specialty like user interface design and user experience require a different need of focus all the while being in a close-knit relationship with the discipline as a whole.
- Software engineering needs specialization. As hinted above no-one in this day and age can claim to be an expert general practitioner programmer. There is simply too much to know. When "back-end" folks aren’t expected to produce the front-end – then we’ve made significant strides.
Links
Books
- Why Software Sucks... and What You Can Do About It
- The Invisible Computer: Why Good Products Can Fail, the Personal Computer Is So Complex, and Information Appliances Are the Solution
My favorite quote from David is when he uses "reptilian midbrain" in a user interface explanation without breaking a sweat! ;)
Progress in User Interaction Design
While producing this show I found an interesting post on TechCrunch, Microsoft Researchers Get Fancy with a Sphere Display. Here is a video of the demonstration.
The "surface" appliances seem to be forging closer to the idea of having software that just works.
Popular Mechanics did a spot on the surface table. In this video you see how wireless devices interface with each other using the surface table as an intermediary. The best part? You can take a picture on your digital camera and load it on your cell phone: no cables, no syncing and no hassle!
The last video I have for you’re here is of the TouchWall. What I like best about this video is how they spend time explaining how the technology works.
Listen to the Show!
My week spent in Orlando at TechEd 2008 was time well spent. Tradeshows like these are a great opportunity to meet smart people who are often delivered by the plane-load.
One of the highlights of the show was being able to see Bill Gates give his final keynote address. Before his talk they ran an updated version of his famous "last day at Microsoft" video. In case you haven’t seen it yet I have included it here for you.
Silverlight Ingenuity
After the keynote was over I setup my machine in the wifi area and started to chat with the guy who happened to be standing next to me. It turns out that guy was David Kelly of Identity Mine head of the implementation team for Crossfader.
Watch the Crossfader demo from the keynote speechCrossfader is a social networking application for creative types – built in Silverlight. David shares about the thought process and feedback they’ve received while in development. We’re still a few weeks away from the launch of Crossfader, but it should prove to be an engaging site.
David also runs Hacking Silverlight a blog dedicated to providing excellent Silverlight content. He’s even started a Codeplex project which features Silverlight resources that will grant you access to the scroll bar as well a browser history "hack" - all in Silverlight.
Web, Windows, Both or None?
Ted Neward talk, Pragmatic Architecture: User Interface, caught my eye so I tracked him down to discuss the five fundamentals of UI:
- Style
- Implementation
- Perspectives
- Cardinality
- Locality
Ted made some excellent points - especially after I started our chat by trying to get a rise out of him!
Take My Dialog… Please!
Finally Kate Gregory spends time with us to explain the Vista Bridge and how you can easily bring the Vista experience to your applications.
Listen to the Show!
Jess Chadwick describes how to integrate the ASP.NET AJAX framework with ASP.NET MVC. With a few tricks up his sleeve, Jess makes it easier than it seems.
Jess is "Lead Code Monkey" at Infragistics, president of the New Jersey .NET User Group and contributor to the Code Camp Server project.Resources
- Jess' Sample Code
- Download the AJAX Library
- Ajax with the ASP.NET MVC Framework
- ASP.NET MVC Preview 4 Release (Part 1)
- AJAX support in the ASP.NET MVC Framework
- AJAX Panels with ASP.NET MVC
Are You a Crackpot?
I ran across the "Crackpot Index" and thought it was hilarious. This is a quiz of sorts you can take to see if your scientific theory propels you into true crackpot status.
Sometimes I think we need something like this for the development community ;)
Below are some of my favorites:
- 5 points for each such statement that is adhered to despite careful correction
- 10 points for each claim that quantum mechanics is fundamentally misguided (without good evidence)
- 10 points for mailing your theory to someone you don't know personally and asking them not to tell anyone else about it, for fear that your ideas will be stolen
- 10 points for each statement along the lines of "I'm not good at math, but my theory is conceptually right, so all I need is for someone to express it in terms of "equations"
- 20 points for naming something after yourself. (E.g., talking about the "The Evans Field Equation" when your name happens to be Evans.)
- 30 points for suggesting that Einstein, in his later years, was groping his way towards the ideas you now advocate
- 40 points for claiming that the "scientific establishment" is engaged in a "conspiracy" to prevent your work from gaining its well-deserved fame, or suchlike.
- 50 points for claiming you have a revolutionary theory but giving no concrete testable predictions.
You can read all 37 criteria here.
I recently created a number of screen casts that highlight the flexibility of one of NetAdvantage ASP.NET's controls - the WebSpellChecker. I share them here for your spell checking pleasure.
Introduction to WebSpellChecker
Implementing Auto Check with WebSpellChecker
Spell Check Multiple Controls on a Page
If you would like to experiment with the controls you can download a demo of the suite here.
Listen to the Show
Pete LePage is Product Manager of Internet Explorer Developer Division and he doesn’t want your web site to stink. Sharing from his talk given at TechEd 2008, Pete highlights 10 common web design mistakes and tells you how you can bypass the same blunders. Pete also tells us how future features of Internet Explorer will help your visitors leave your site with a smile.
Pete mentioned a number of resources to make your life easier.
- Pete's blog
- Pete's Twitter feed
- IE Team blog
- IE Center
- Code Validators
- IE8 Activities
- IE8 Webslices
The Mistakes
The following list is Pete's designated top 10 mistakes.
- Lousy and out-of-date content
- Non-designers doing design work
- Obtrusive Advertisements
- Poor Search Engine Optimization
- No Rich media Fail Over Experience
- Bad workflow for users
- Incosistent site design
- No easy navigation
- Not isolating hacks
- Errors in code
Mistakes Right Here
In the vein of "lousy content" in our previous show, Full Disclosure Debugging, I mistakenly credited authorship of a blog post entitled "Easier Debugging with Attributes" to the wrong person. Rob Prouse is the man of the hour and runs an insightful blog over at alteridem.net. I am glad I made this mistake... after looking over Rob's blog a little closer I found quite a few gems. I am now a subscriber - you should be too!
Laughable Lessons Learned
Vince Flanders of Web Pages That Suck offers a hilarous critique of web design gone up in smoke.
Sometimes learning from the best can mean learning from the best mistakes. Check out Vince's list of 2007's top offending web pages for further instruction.
(Seriously guys... some of these mistakes have no place in 2007!)
7 Steps to WPF Proficiency
Need to learn WPF and fast? Sign up for Windows Foundation Boot Camp lead by Infragistics professionals and walk away tooled up in the following areas:
- WPF Overview
- Fundamentals of a WPF Solution
- User Interaction with Controls
- A Deeper Look into Text
- Graphics Overview
- WPF Data Binding 101
- Advanced Topics — Styling, Interop and Performance
Sign up today!
Listen to the Show
Steve Schofield is an IIS expert working for webhost ORCS Web. Steve and his team are responsible for such sites as Channel9, ASP.NET, weblogs.asp.net and ASP Alliance. As a member ASP Insiders and a IIS MVP - Steve knows his way around a web server.
Steve sheds light on how the new features in IIS7 make it easy for developers to have more control over the request/response execution.
Resources
- Steve Schofield's blog
- IIS.NET
- ASP.NET "Hacks"
- SubSonic 2.1 Aggregate Query Examples
- Free Icon Sets
- Dot Net Kicks
Listen to the Show
Debugging guru John Robbins brings to life the saying, “you cannot debug what you cannot see.” John is generous with guidance and resources that illustrate why knowing a little about the .NET plumbing can go a long way. Highlighting the show is John’s account of how he helped find a very obscure bug in a complex multi-machine system. Don’t miss this one!
John Robbins is a co-founder of Wintellect and is a sought-after author, speaker and consultant specializing in the art of debugging.
See John present Live at Devscovery in Redmond August 19-21 2008.
Resources
- Easier Debugging with Attributes
- Tess Ferrandez’s Blog
- Concurrency: MSDN site for parallel computing
- Reflector
- .NET reference source code (use John’s handy downloader tool)
Thanks to Aaron Lerch for a great question that spring-boarded into an entertaining war story!

