The developer-as-UI-designer requirement: Flexibility

After two years or so of having my thumb up my, uh, nose, and not writing any meaningful code for myself (and my damn forum app), I realized that perhaps the most important requirement isn't adhering to data API's or connecting to various frameworky things, but rather the flexibility to design UI with as little code as possible.

For example, you want to build a general purpose blogging app. It should be simple and easy to hack, and above all, it should be as simple as possible to change the way it looks. My first attempt at such an effort a year or two ago wasn't great, but I learned a lot from the experience. It's making the forum rewrite a lot easier.

There are two things that make flexible UI easier. The first thing is template-based controls. Yes, there are a great many of these already in ASP.NET. But the thing is, once you've developed your own, you start to realize just how much more you can do beyond the standard grids and repeaters (all of which do a ton, but never exactly what you want). You can start to do controls that also have their own paging templates, categorized header templates, ad templates, etc. Even more fun, you can start writing events to do neat things from code when the data is bound, like display certain images or whatever.

The other thing that's fun to do is what I call "controller" objects. With a little mark up, they do something cool to other things on the page. Maybe they turn visibility on or off to certain elements, or bind data, or even manipulate the title of the page. This isn't a new idea really, as DataSource controls, script managers and WebPart management components should be familiar to most people by now. Doing this kind of thing in a declarative manner keeps your code clean and truly lets you focus on the presentation. 

No Comments