An Overview of the UniveRSS Architecture

by Keyvan Nayyeri
Summary
The purpose of this article is to help readers familiarize themselves with the architecture of the UniveRSS application and to understand the source code better.

In this article we firstly define our goals then list all essential requirements to reach to them and give a general overview of the UniveRSS architecture with respect to these goals and describe each component of the architecture in detail. Finally we will cover the general implementation of these snippets of source code.
Background
In previous articles of our series about the UniveRSS showcase, we covered some prerequisites of the project. Having a good understanding of Windows Presentation Foundation and XAML, Windows RSS Platform and Animations in Windows Presentation Foundation are essential prerequisites in working with the UniveRSS source code.

After getting familiar with these requirements, it’s time to delve into the details of UniveRSS which is our main goal in these articles. The best way to get started with the UniveRSS showcase to take a look at its architecture. It is recommended that you download the last version of UniveRSS source code before going through this article about a general overview of the UniveRSS architecture. This enables a peek at the the core of UniveRSS and an initiation into its source code.
Goals
Let's begin by defining the goals and requirements of the UniveRSS application.

UniveRSS is a 3D Feedreader written in C# code within the guidelines of the Windows Presentation Foundation, running on .NET Framework 3.0.

A Feedreader should basically be able to:

  • Manage a list of feeds (add, delete and edit them).
  • Organize them in folders and subfolders.
  • Download their data on a regular basis and keep them up to date.
  • Notify on new items in a feed.
  • Show all new and old items in a visually pleasant manner.
Knowing these goals helps us understand our requirements in next step and choose the best way to accomplish these goals. Bear in mind that the primary goal of UniveRSS in “The Panel” showcase is to demonstrate the capabilities offered by the Windows Presentation Foundation or, in other words, what the end user sees. Therefore most of the work available for this application is based on this goal.
Requirements
In the UniveRSS application we manage and organize all feeds using Windows RSS Platform APIs and download them with a Feed Download Engine. So there aren’t many things to do on our side to attain the first three goals outlined in the previous section. The Windows RSS Platform and Feed Download Engine were discussed in a separate article.

Notification of new feed items is unavailable in the current version of UniveRSS. Only all feeds with new items in the list are shown.

Most of the code is geared towards achieving the last goal of an attractive visual output, with WPF, XAML and C# coming into play.

Additionally there are three secondary requirements to the primary goals which play a role in our architecture:

  • Content of original feeds is provided in HTML format but Windows Presentation Foundation does not present HTML codes in UI directly (XAML markup codes to format text are used instead). Therefore a converter to convert this HTML content to XAML Codes and present them to end user is needed.
  • Windows RSS Platform provides helpful tools to work with feeds and manage them but an intermediate component that aids working with these APIs is required.
  • We should use our custom controls to display the output to the user so it seems logical to have a set of custom controls for UniveRSS as another component to use them in UI.
General Architecture
After defining our goals and requirements now we can show the architecture and map different components of this architecture to abovementioned goals and requirements.

UniveRSS' very simple architecture is shown in Figure 1.
Figure 1

Animation Figure 3
This architecture is described from the lower level to upper level. At the lowest level we see Windows RSS Platform APIs which provide us some tools to work with feeds and manage them. In the upper level there is a Feeds component which helps when working with Windows RSS Platform and is a part of the UniveRSS code.

The HTML Converter component converts the content of feed items from HTML to XAML.

The next level consists of core APIs for business logic. This level has two types of collaborations with lower levels. For some usages it directly works with Feeds components and for other times it works with the intermediate HTML Converter component. Business level is where we have implemented our main logic to work with feeds, manage them, fetch the feed data and present them.

The uppermost level is the User Interface which displays the output to the end user. This layer is all about Windows Presentation Foundation and XAML and has a small component in its core for custom controls.

From a workflow point of view, Windows RSS Platform and its Feed Download Engine update all feeds and fetch new feed items based on user settings that are entered beforehand. The Feeds component tries to provide some tools for working with RSS Platform APIs. Business component tries to work with Feeds component to get its required data in two ways:

  • Using an intermediate component (HTML Converter) to convert pure HTML codes to XAML codes in order to show them in UI. This case usually happens when UniveRSS wants to get the details of a feed item and present them.
  • Working directly with Feeds component to manage feeds.
After fetching required data and converting them to appropriate output it’s time to show them to users in the user interface. User Interface uses several custom controls to show the data, get user events and pass them on to the business layer.
How Architecture is Implemented in Source Code
To let readers familiarize with the UniveRSS source code, here is a short description about implementation of the above architecture in the current source code. Please notice that this section may meet some changes in next releases.

Current source code of UniveRSS consists of 5 projects. A brief description is provided below:

  • UniveRSS.Feeds: This class is where you can find Feeds component from the architecture.
  • UniveRSS.HtmlConverter: This class is the implementation of the HTML Converter component that converts HTML codes to XAML.
  • UniveRSS.Common: This project contains common classes used everywhere in the solution e.g. value converters and RoutedUICommands.
  • UniveRSS.Controls: All WPF custom controls for UniveRSS UI are located here and their code implementation can be found in this project.
  • UniveRSS: This last project is where you output is presented to the user, user choices are pulled and passed along to lower levels. In fact, this project is our User Interface code.
Keyvan Nayyeri has been a geek and programmer since he was 10. He has a BS degree in Applied Mathematics and as an experienced software architect and developer he is also a MVP from Telligent for Community Server technology. Keyvan is a co-author for Wrox press and also an author for ASP Alliance, DotNetSlackers and Code Project .NET communities. Currently he’s contributed in some projects such as BlogML, CSModules and Windows Live Writer Plugins. He edits his blog on .NET, Community Server and Technology.
The showcases on the Panel website provide examples of the possibilities within the new technologies and source codes serving as a blueprint for beginners learning to leverage these technologies. The development of the UniveRSS feed reader and other showcases on the Panel website are accompanied by articles with detailed information on the projects' underlying technologies.

The following topics are featured in this series of articles:
  • An introduction to UniveRSS, Windows Presentation Foundation, XAML and Internet Explorer 7 platform.
  • General architecture of UniveRSS and step by step guide of its development details.
  • An overview of the Windows RSS Platform
  • The use of animations in WPF
  • An overview of the UniveRSS Architecture
You can subscribe to your local MSDN Flash newsletter using the Panel registration to get notifications of new articles.
© 2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement