Software Reuse: Software Architecture

Modular Software

One of the primary goals of modern Software Development is the creation of code that is reusable. This is known as Software Reuse or Code Reuse and the results so far are pretty disappointing. There are a number of reasons for this:


  • There are multiple software architecture options available
  • There are multiple design methodologies available
  • There are multiple test methodologies available
  • There are different languages and runtime environments
  • It is hard to conceive of all the way a module might need to operate in the future
  • Requirements capture is still not a reliable process
  • Making code too general can also make it unwieldy to use
  • Documenting code so it can be used again is not easy


This begins a series of posts looking very briefly at each of these factors.


Software Architecture

I consider Software Architecture to be a fundamental component of the success of a software system. But there is a strong dependency with requirements capture. Because the purpose of choosing a particular architecture is to satisfy the requirements within constraints such as the Hardware Platform.


Grady Booch is one of the world’s leading experts on Software Architecture and had an excellent series of podcasts at On Architecture.


Software Architecture

Software Architecture

The diagram above shows a simple Software Architecture for a process control module. It is missing the link that shows how the messages or instructions with the control tags get to the module, but it does show how the system components relate to each other after that. Like most software problems, it has to be abstracted so we can handle the details in bite sized chunks (or should that be byte sized chunks?). In this case the elements being managed are:


  • inputs from a machine under control
  • outputs to control the machine
  • a start-up and shut-down process
  • a human interface device so users can either get reports from the system or interact with it
  • some form of control language using tags that defines the machine control


And the Software Architecture shows that there are several internal processes for handling the inputs, outputs, HMI and control tags.


The original concept of Software Architecture comes from real architecture. There are foundations, services, facilities, reception, storage and other floors all the way to the top floor. The highest floor represents the highest level of abstraction and generally the highest value adding process. The foundations represent the things that must exist or there can be no system. These are generally the lowest level drivers and IO device controls. And the diagram shows how the pieces relate to and depend upon each other.


And of course, all the floors need to be connected, so you have elevators, stairs, electrical cabling, networking, air conditioning, water and other plumbing. These are like the operating and communications systems.


Things that need to be clearly defined for a system to be able to be designed with confidence are:


  • Control Flow – how is control and execution managed?
  • Data Flow – how is information moved around the system?
  • Timing and Latency – what tasks and response are time critical and which can be handled whenever they can be fitted in?
  • What are the system constraints: memory, speed, worst case response times


From this you can design your Software Architecture just like an Architect designs a building.


Next we will look at Operating Systems and how to determine the level of complexity needed.


Successful Endeavours specialise in Electronics Design and Embedded Software Development. Ray Keefe has developed market leading electronics products in Australia for nearly 30 years. This post is Copyright © 2011 Successful Endeavours Pty Ltd