Why and How to Document your Software Architecture

Coding the Architecture provides a very nice slide set giving a very good high level overview of why and how to document your software architecture in a practical way. As I wrote, it is a slide set and therefore only provides very short summaries on the different aspects. Nevertheless, it provides some good suggestions which topics should be covered and how to document them.

Key takeaways:

  • Software architecture documentation should be complementary to the code and describe what the code itself doesn’t. For example, it’s really hard to identify things like architectural principles, operational aspects and how security works from just the code itself.
  • Keep it short and useful
  • What it should contain:
    • Explanation of the software structure
    • The architectural principles and constraints
    • Development and deployment technologies and platforms
    • A justification of how the architecture satisfies the requirements

You can find the slide set here.

BTW: Coding the Architecture contains a lot of useful resources for software architects.

97 Things Every Software Architect Should Know

In this truly unique technical book, today’s leading software architects present valuable principles on key development issues that go way beyond technology. More than four dozen architects — including Neal Ford, Michael Nygard, and Bill de h ra — offer advice for communicating with stakeholders, eliminating complexity, empowering developers, and many more practical lessons they’ve learned from years of experience. Among the 97 principles in this book, you’ll find useful advice such as:

  • Don’t Put Your Resume Ahead of the Requirements (Nitin Borwankar)
  • Chances Are, Your Biggest Problem Isn’t Technical (Mark Ramm)
  • Communication Is King; Clarity and Leadership, Its Humble Servants (Mark Richards)
  • Simplicity Before Generality, Use Before Reuse (Kevlin Henney)
  • For the End User, the Interface Is the System (Vinayak Hegde)
  • It’s Never Too Early to Think About Performance (Rebecca Parsons)

To be successful as a software architect, you need to master both business and technology. This book tells you what top software architects think is important and how they approach a project.

You can find the 97 things for free here.

Android Fragmentation

Google announced on its Android Developers Blog that they are now providing a device dashboard showing the distribution of the Android version accessing the Android Market (later on also including hardware characteristics of devices).

As a developer, I often wonder which Android platforms my applications should support,especially as the number of Android-powered devices grows. Should my application only focus on the latest version of the platform or should it support older ones as well?

To help with this kind of decision, I am excited to announce the new device dashboard. It provides information about deployed Android-powered devices that is helpful to developers as they build and update their apps. The dashboard provides the relative distribution of Android platform versions on devices running Android Market.

In summary, Android 1.5, 1.6, and 2.0.1 are the 3 versions of the platform that are deployed in volume. Our goal is to provide you with the tools and information to make it easy for you to target specific versions of the platform or all the versions that are deployed in volume.

We plan to update the dashboard regularly to reflect deployment of new Android platforms. We also plan to expand the dashboard to include other information like devices per screen size and so on.

Don’t get me wrong: the data is very interesting. However, it strongly reminds me on the situation on Windows, where still about 30% of the users use Windows XP. Having such a big fragmentation of OS versions really forces you to either make big compromises and build your application only using the features of the lowest OS version or to make your application adapt to the OS version it is running on. The later one adds a lot of trouble in development efforts, testing and bug fixing.

Still, it will be interesting to see how the fragmentation of Android devices evolve and how this will influence the attraction of developers providing Apps for the Android OS. Of course, having developers focusing only on certain Android OS versions and/or hardware characteristics could also make the hardware vendors streamline their hardware specs and OS versions. Selling Android devices which show only very few apps on the Android Market might not sell so well after all.

Links for Software Architects

Over the time, I have collected some links to websites and articles with topics interesting for Software Architects. Since they might be of interest for others, too, I am providing them here for you. If you also have some links which you think are interesting for other Software Architects, please let me know.

Links for Software Architects weiterlesen

How to detect and avoid memory and resources leaks in .NET applications

MSDN features an article covering reasons why and how managed applications can suffer from memory leaks, how you can find them and get rid of them:

Despite what a lot of people believe, it’s easy to introduce memory and resources leaks in .NET applications. The Garbage Collector, or GC for close friends, is not a magician who would completely relieve you from taking care of your memory and resources consumption.

I’ll explain in this article why memory leaks exist in .NET and how to avoid them. Don’t worry, I won’t focus here on the inner workings of the garbage collector and other advanced characteristics of memory and resources management in .NET.

It’s important to understand leaks and how to avoid them, especially since they are not the kind of things that is easy to detect automatically. Unit tests won’t help here. And when your application crashes in production, you’ll be in a rush looking for solutions. So, relax and take the time to learn more about this subject before it’s too late.

How to detect and avoid memory and resources leaks in .NET applications weiterlesen

Tooltips for indivual cells of a DataGrid

Just recently,  I have been faced with the question on how to add cell dependent tooltips to individual cells of a DataGrid in Silverlight. If you generate the columns by yourself, the task is straight forward by using the appropriate data template for the cell. Something like this:

<Data:DataGrid>
   <Data:DataGrid.Columns>
      <Data:DataGridTemplateColumn>
         <Data:DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
               <TextBlock  Text="{Binding ColumnProperty}"
                    ToolTipService.ToolTip="{Binding ColumnProperty}"/>
            </DataTemplate>
         </Data:DataGridTemplateColumn.CellTemplate>
      </Data:DataGridTemplateColumn>
   </Data:DataGrid.Columns>
</Data:DataGrid>

However, if you let the columns be autogenerated by the grid, things are not so straight forward anymore. Tooltips for indivual cells of a DataGrid weiterlesen

WCF Services with Large Responds

If you happen to develop a WCF service that needs to deliver large amount of data to your Silverlight application, you might run into the problem that the data will never reach your application but instead you might just get an exception like „System.Net.WebException: The remote server returned an error: NotFound„.

There are two possible reasons for this:

  1. The transfer mode of your service being set to „Buffered“ and the size of the data being transferred is bigger than the buffer size.
  2. There are two many items to be serialized and deserialized by the DataContractSerializer.

WCF Services with Large Responds weiterlesen

Understanding WCF Services in Silverlight 2

NetFX Harmonics provides a in-depth and well written introduction on how to write and use WCF services in Silverlight applications:

In this document, I’m going to talk about how to access WCF services using Silverlight 2 without magic. There will be no proxies, no generated code, no 3rd party utilities, and no disgusting „Add Service Reference“ usage. Just raw WCF. This document will cover WCF connectivity in quite some depth. We will talk about service setup, various WCF, SOA, and Silverlight paradigms, client setup, some security issues, and a few supplemental features and techniques to help you aide and optimize service access. You will learn about various WCF attributes, some interfaces, and a bunch of internals. Though this document will be in depth, nothing will ever surpass the depth of MSDN. So, for a more full discussion on any topic, see the WCF documentation on MSDN.

Even though we’re focusing on Silverlight, most of what will be explained will be discussed in a .NET context and then applied to Silverlight 2. That is, instead of learning .NET WCF and Silverlight WCF, you will .NET WCF and how to vary this for Silverlight. This comparative learning method should help you both remember and understand the concepts better.

Read the full document here.

Dependency Injection using Unity

A nice high-level overview of  the technique of Dependency Injection using Microsofts Unity framework can be found in the May release of the MSDN magazine.

These principles include maintaining separation of concerns, using abstraction to implement loose coupling between layers and components, implementing service location capabilities, and managing crosscutting concerns such as logging and security. While these may seem to be desirable but unrelated aims, one technique can help you to apply several design principles easily. The Dependency Inversion principle implies separation of concerns through abstractions rather than concrete implementations. In terms of design patterns, you can achieve this by applying the Inversion of Control (IoC) pattern and its related pattern, Dependency Injection (DI).

The theory is simple enough. Instead of specifying at design time the actual concrete type that each class or component will use to perform some activity or process, you arrange for these classes or components to retrieve the appropriate object from a container that you previously configured with type maps and registered types.

Dependency Injection is great for achieving loose coupling of components. There are a lot of tools available that can be used for injecting dependencies. A list of such tools can be found on the Wikipedia page as well as on the Clean Code Developer Tools page.