Gradually Improving Software Design with examples in C#

Gradually Improving Software Design is the series of lectures that are following one specific line of thought.

Through a number of real world examples, attendees will get acquainted with design and coding practices that will help them improve their code “here and now”.

Below is the complete list of lectures, divided into 4-hour blocks. The entire training takes 20 hours.

In any particular case, it is possible to join or divide lectures in a different way, or even to choose a subset and combine them into a different course.

Fenix HR

List of lectures divided into 4-hour blocks

Principles of Object-Oriented Programming 1

This block is useful to programmers of all levels of expertise and knowledge. Through a process of refactoring, redesigning and extending a number of examples, attendees are acquainted with principles of writing clean, extendible and maintainable object-oriented code.

  1. Emergent Objects – Simplifying code through removal of optional arguments; letting objects emerge to substitute branching instructions, loops, etc.
  2. If-then-else and guard clauses – Understanding the purpose of branching and guard clauses in order to use them properly and where appropriate.
  3. Loops and sequences – Understanding the purpose of loops in light of theory of sequences. Special attention paid to implementations of IEnumerable interface.
  4. Map-reduce principle – Capitalizes on theory of sequences, leading to gross simplification of code that works with collections of data.
  5. Class dependencies and strategies – Introduces dependencies and their special cases; explains the effect of dependencies on polymorphic execution.
  6. Value objects – Distinguishes value objects from entities; explains aliasing bugs and the ways they can be avoided through use of immutable objects.

Principles of Object-Oriented Programming 2

This block explains advanced object-oriented programming and starts introducing design patterns into code.

  1. Removing null references – Shows practical techniques to remove almost all null references from code.
  2. Managing optional objects – Introduces Option functional type to replace remaining null references.
  3. Refactoring to patterns – Makes distinction between refactoring and redesign; demonstrates the place of design patterns in fixing design issues.
  4. Evolution of patterns – Demonstrates evolution of design pattern implementation from simplest to more and more complex as design goals grow larger.

Design Patterns for the Real World

This block of lectures demonstrates how design patterns can be applied in real world projects. All examples come from practice, which adds to their usefulness.

  1. Combining patterns – Shows cases where a single pattern doesn’t resolve design issues; then shows efficient solutions that combine two patterns.
  2. Meeting design goals – Explains a method based on following design goals which leads to application of a certain design pattern.
  3. Morphing patterns – Shows methods that allow simpler design patterns to evolve into more complex ones with similar object roles.
  4. Patterns in testing – Demonstrates specific application of patterns in unit and integration testing, where they help create complex mock object, perform complex assertions, produce test data, etc.

Principles of Object-oriented Design

These lectures are providing theoretical insight which is generally lacking in development teams.

  1. Method preconditions – Explains importance of method preconditions; introduces Code Contracts library.
  2. Object substitution – Explains how and why Substitution Principle works in OO languages; introduces Liskov Substitution Principle to demonstrate distinction between structural and behavioral subtyping.
  3. Abstract data types – Introduces abstract data types and demonstrates their importance in class design.
  4. Design by Contract – Introduces Design by Contract; demonstrates improvements caused by introduction of contracts in design.
  5. Interface Segregation Principle – Shows how to improve design through careful application of ISP; introduces fluent interface as implementation of ISP.
  6. Interface contracts – Applies Design by Contract to interfaces; demonstrates significant simplification of classes that are implementing interfaces with contracts.

Advanced Object-oriented Design

Covers some of the advanced techniques in class design, which can be applied to produce quite effective and powerful designs.

  1. Fluent interface – Considers consistency problem for objects implementing fluent interface; applies immutable objects to fluent interface design.
  2. Strategies – Introduces strategies as a flexible method to drive object state transformations; special attention paid to pros and cons of lambda functions.
  3. Composition vs. Inheritance – Explains practical aspects of class inheritance and object composition; demonstrates good aspects of object composition, but also warns of troubles that it may cause.
  4. Inversion of Control – Explains importance of IoC in light of object composition; introduces IoC containers.
  5. Module dependencies – Introduces macro-design through such concepts as abstractness and stability of modules; introduces code metrics.