views:

74

answers:

2

Lately I've been working on applications that are relatively data-oriented. In general, they tend to be editors for data represented by classes that are related in odd ways. I've been handling it by having a UserControl for each type of object and as the selection changes the program displays the appropriate editor for the object.

The "framework" I have made for this feels clunky and messy. In general, I have a two-pane interface with an "item selection" control on the left and the "work area" on the right. The UI has to do most of the work of responding to item selections by determining what UserControl to display, and implementing behaviors like undo and asking if the user wants to save data before changing items can get messy. The inspiration for this post is a nice "make our build process easier" application I'm working on with a colleague but it's really out of hand to the extent that a well-designed rewrite will probably arrive faster than the current code will be completed.

I've got a passing familiarity with the document/view architecture from reading a little bit of some C++ books. I understand the more modern counterpart to it in .NET might be the Composite UI Application block. The problem is I've never seen anything but quick walkthroughs or howtos on these topics. It's never from the viewpoint of "how you should design an application for this" but more from the viewpoint of "paste this into the application and you'll understand!" I've spent an hour or two digging through the CAB documentation but it's somewhat confusing to me. I don't like the CAB mainly because I'm curious how things work under the hood and I think I'd appreciate it more if I were able to implement a simple version of a similar pattern before I dive into using a framework.

What I really think I need is a website or book focused on this issue. The big part I don't seem to get is how to separate concerns into the appropriate places; I'm used to designing my data classes with several methods to work with the data, and it seems like maybe that's the job of a controller object? What sources do you find useful for an introduction to this subject? I've seen lots of articles that draw nice diagrams like this and I get the high-level idea of how these architectures work. I don't think I've ever found the right source to teach me the low-level "how to implement it" part.

+1  A: 

I find this article by Martin Fowler to be an excellent overview of a variety of UI architectures. Hope it helps :)

Luke Halliwell
A: 

I accepted @Luke H's answer because it ultimately led me to several resources that are pretty decent.

  • Martin Fowler's books look top-notch and are in my queue.
  • The Build Your Own CAB Series by Jeremy Miller does a really good job.
  • It looks like I'm a little too ignorant of design patterns to continue, so I'm reading Head-First Design Patterns followed by the Gang of Four book to help there; after that I plan on digesting Fowler's works.
OwenP