Skip to main content

 

Partitioning and Layering a Software Application

How do you design your software to be more adaptable to changing technologies, fixing bugs and new requirements? Everyone answers: use layering. But exactly how do you develop software layers, or create application interfaces that allow you to make these changes? This course will focus on techniques such as interface-based design, proper use of inheritance, inversion of control, factories, facades, and other patterns and techniques. It will demonstrate these principles by walking through the process of transforming a tightly coupled application into a properly layered one. The examples are in C#, but the principles apply to any programming language.


Learning Resources

Published on: 7/19/2010
Author: Michael Stiefel, Reliable Software, Inc.


Number 1 image

Partitioning and Layer Fundamentals
In this module you'll learn the fundamental principles of partitioning and layering. We will start to demonstrate these principles with interface-based design.

 

Number 2 image

Extending Interface Based Design
We will now demonstrate how to properly divide your logical design into physical components by treating interfaces as types. This will facilitate the independent evolution of parts of your design by different developers. By making testability much easier, it will allow you to validate your design as it evolves using testing. We will also introduce the concept of refactoring and the factory design pattern.

 

Number 3 image

Domain and Persistence Patterns
Isolating the application from the details of the how the data is stored allows you to modify the application and the database independently. This issue is at the core of the object relational mismatch, where the modeling of an application's domain with objects clashes with the modeling of data in a relational database. You can use domain and persistence patterns to alleviate the difficulties with this clash. Even if you use other storage mechanisms, or do not have a domain object model, it is still important to isolate the application and data layers.

 

Number 4 image

Inversion of Control and MVC
This unit discusses two important items: Inversion of Control and Model-View-Controller. Inversion of Control occurs when an object's external dependencies are provided to it, rather than having the object create its own dependencies. You can then write code in a more generic and flexible fashion. It also allows you to improve the testability of your application. The Model-View-Controller pattern is important for isolating the business logic from the user interface. This improves the testability of the application and allows the user interface and the business logic to evolve independently.

 

Number 5 image

Transforming the Application
Now we will demonstrate how a properly partitioned application can easily be modified. We will convert our console application to a web app, use SQL Server as our data store, and introduce web services very quickly.

Have questions or feedback? Send us e-mail.