Visual Studio 2010!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Creating a GUI Feedreader using C++, Part 1: A No-Brainer Guide to UML
By Nick Chase

Rate This Article: Add This Article To:

Creating a GUI Feedreader using C++, Part 1: A No-Brainer Guide to UML - ' Putting Things Together '
( Page 5 of 5 )

Putting things together: Component and Deployment diagrams

So far, we've looked at a number of different ways to model the behavior of the Chaos Crusher application. Now we're going to look at modeling the architecture using component diagrams, which provide a conceptual view of how we'll put it together, and deployment diagrams, which provide a more concrete look at the system.

Component Diagrams

Component diagrams provide a way for you to group functionality together. For example, the Chaos Crusher application has three basic components: the FeedReader, the CCGUI, and the CCArchives. You can see them in Figure 16.

Each component shows any interfaces that are exposed or required. For example, the FeedReader component provides access to the Feed interface, as indicated by the "lollipop" notation. Similarly, the CCArchives component provides access to the Archive interface.

Figure 16: The component diagram

On the other hand, the CCGUI component, which controls the actual visual portion of the application, needs access to the Feed and Archive interfaces. These icons actually work out well, because they enable you to create an assembly that shows the relationship between components, as you can see in Figure 17.

Figure 17: The Chaos Crusher components

Of course, in a component diagram it's still conceptual. You can make more concrete choices in a deployment diagram.

Deployment Diagrams

Deployment diagrams enable you to get as specific as you like in determining what hardware and software you'll be using, and how they fit together. For example, Figure 18 shows a very simple version of a Chaos Crusher client:

Figure 18: A simple deployment diagram

Here we have one node, as indicated by the 3D box, that's designated as a Client PC named Groucho. Note you can get very specific for these nodes, indicating brand, model, and so on, which comes in handy if you're planning a new installation that involves specific hardware requirements. In some cases, a deployment diagram shows actual existing machines.

In this case, I've simply said that on the main node, my PC, I'll have two artifacts, or physical files, named ChaosCrusher.dll and ChaosCrusher.exe. The dashed arrow indicates that the ChaosCrusher.exe artifact depends on the ChaosCrusher.dll artifact. If ChaosCrusher.dll is missing, ChaosCrusher.exe won't work.

Of course, it would be nice if we could tie the deployment diagram into some of the modeling we've already done, and we can do that by pulling in information on the components, as you can see in Figure 19:

Figure 19: The Chaos Crusher deployment diagram

In this diagram, I'm looking forward to a time when I can run a Chaos Crusher client anywhere and get access to my personal repository of information, which will be running on a web server. The client PC has the same artifacts as in Figure 18, but now we can see how they manifest the components we've already created.

One More for Good Measure: Timing Diagrams

One truism about UML is that it's rare that you'll find a situation in which you'll need all of the different diagrams available to you. In fact, there is one more diagram that I just can't realistically cram into this model, and that's the timing diagram. Timing diagrams show the relative time periods between states, as you can see in Figure 20:

Figure 20: A timing diagram

In this diagram, we see that the application starts in the Updating state, in which it's looking at a feed for new content. After two minutes, it's either completed that task or failed to contact the site, so it goes into the Waiting state. It stays there for another 58 minutes, after which it goes to the Checking state, where it spends two minutes looking to see whether the feed should be updated.

Next Steps

In this article, we looked at the diagrams that are part of the Unified Modeling Language 2.0 while modeling a small portion of the Chaos Crusher FeedReader application. UML enables you to model both the structure and behavior of your application, and once you get the hang of it, you may find that you want to do more with it. I suggest that you check out the following resources for more information on UML's capabilities.

  • Find the latest specifications, as well as tutorials and other tools, on the official UML Resource Page, http://www.uml.org/
  • Read The Unified Modeling Language User Guide or The Unified Modeling Language Reference Manual (2nd Edition) for information on UML itself, and Professional UML with Visual Studio .NET for information on using Microsoft tools to generate it.


 
 
>>> More ASP and .Net Coding Techniques Articles          >>> More By Nick Chase