Microsoft TechTalk: S.O.L.I.D. Principles and DDD

Posted by

On September 18, 2014, I held a Tech Talk at the Microsoft Switzerland Offices in Walisellen. The title was “Enterprise Software Architecture and Domain-Driven Design”. The main goal of the talk was to explain that with the .NET Framework getting more and more mature, it becomes ever more important to think about how we deal with legacy .NET code, that is existing .NET code.

Everyday, more and more .NET projects will not start from scratch but start on an already existing code base. Therefore, we as developers need to understand how to reduce our legacy by writing more maintainable code.

The SOLID Principles are an approach on how to write modular code that enables reuse scenarios. Robert C. Martin, aka. Uncle Bob first came up with the principles in the early 2000s.

image

The SOLID principles are:

  • SRP: Single Responsibility Principle
  • OCP: Open/Closed Principle
  • LSP: Liskov Substitution Principle
  • ISP: Interface Segregation Principle
  • DIP: Dependency Inversion Principle

Each of the principles describes an approach to “correctly do object oriented programming (OOP)”.

After I explained the SOLID Principles and showed a couple of demos, we took a look at Domain Driven Design (DDD). DDD is an approach to designing a software solution by following a couple of recommendations.

image

It concentrates on creating a common understanding between the business experts and the developers by creating artifacts such as a common language (the ubiquitous language) and establishing a common model (the domain model), which is a graphical representation of the business domain. Using several DDD techniques, the model is iteratively refined by making it more correct and reducing complexity. A very important concept is to make implicit stuff explicit. Often things that seem simple or even trivial to the developer are absolutely crucial to the business. Therefore, it is vital to give these concepts a name and add them to the model as a visible artifact.

image

Using further techniques such as entities, aggregates, value objects, factories or repositories, the model is then translated into code.

Attached is the slide deck that I used during the presentation.

A big thank you goes out to Microsoft Switzerland for giving me the opportunity and to the engaged crowd for listening and thinking along!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.