Reader small image

You're reading from  Software Architecture with C# 12 and .NET 8 - Fourth Edition

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781805127659
Edition4th Edition
Right arrow
Authors (2):
Gabriel Baptista
Gabriel Baptista
author image
Gabriel Baptista

Gabriel Baptista has been working with software development since the beginning of .NET. Today, his main contributions are managing numerous projects for retail and industry. He is an Azure Platform-as-a-Service (PaaS) solution specialist, teaches at Computing Engineering universities, and helps tech startups as a mentor.
Read more about Gabriel Baptista

Francesco Abbruzzese
Francesco Abbruzzese
author image
Francesco Abbruzzese

Francesco Abbruzzese dedicates his life to his two great passions: software and powerlifting. He is the author of the MVC Controls Toolkit and the Blazor Controls Toolkit libraries. He has contributed to the diffusion and evangelization of the Microsoft web stack since the first version of ASP.NET. His company, Mvcct Team, offers web applications, tools, and services for web technologies. He has moved from AI systems, where he implemented one of the first decision support systems for financial institutions, to top-10 video game titles such as Puma Street Soccer.
Read more about Francesco Abbruzzese

View More author details
Right arrow

Understanding the Different Domains in Software Solutions

This chapter is dedicated to a modern software development technique called domain-driven design (DDD), which was first proposed by Eric Evans (see Domain-Driven Design: https://www.amazon.com/exec/obidos/ASIN/0321125215/domainlanguag-20). While DDD has existed for more than 15 years, it has achieved great success in the last few years because of its ability to cope with two important problems.

The main problem is modeling complex systems that involve several domains of knowledge. No single expert has in-depth knowledge of the whole domain; this knowledge is instead split among several people. The second problem is that each expert speaks a language that is specific to his domain of expertise, so for effective communication between the experts and the development team, objects, interfaces, and methods must mimic the language of the domain experts. This means that the different modules that compose an application must use...

Before you begin: join our book community on Discord

Give your feedback straight to the authors themselves and chat to other early readers on our Discord server (find the "software-architecture-csharp-12-dotnet-8" channel under EARLY ACCESS SUBSCRIPTION).

https://packt.link/EarlyAccess

Qr code Description automatically generated

Design patterns can be defined as ready-to-use architectural solutions for common problems you encounter during software development. They are essential for understanding the .NET architecture and useful for solving ordinary problems that we face when designing any piece of software. In this chapter, we will look at the implementation of some design patterns. It is worth mentioning that this book does not explain all the known patterns we can use. The focus here is to explain the importance of studying and applying them.In this chapter, we will cover the following topics:

  • Understanding design patterns and their purpose
  • Learning some design patterns that can be observed in .NET

By the end of...

Technical requirements

To complete this chapter, you will need the free Visual Studio 2022 Community Edition or better.You can find the sample code for this chapter at https://github.com/PacktPublishing/Software-Architecture-with-.NET-8-4E.

Understanding design patterns and their purpose

Deciding on the design of a system is challenging, and the responsibility associated with this task is enormous. As software architects, we must always keep in mind that features such as great reusability, good performance, and good maintainability are important for delivering a good solution. This is where design patterns help and accelerate the design process.As we mentioned previously, design patterns are solutions that have already been discussed and defined so that they can solve common software architectural problems. This approach grew in popularity after the release of the book Design Patterns – Elements of Reusable Object-Oriented Software, where the Gang of Four (GoF) divided these patterns into three types: creational, structural, and behavioral.A little bit later, Uncle Bob introduced the SOLID principles to the developer community, giving us the opportunity to efficaciously organize the functions...

6 Design Patterns and .NET 8 Implementation

Before you begin: join our book community on Discord

Give your feedback straight to the authors themselves and chat to other early readers on our Discord server (find the "software-architecture-csharp-12-dotnet-8" channel under EARLY ACCESS SUBSCRIPTION).

https://packt.link/EarlyAccess

Qr code Description automatically generated

Design patterns can be defined as ready-to-use architectural solutions for common problems you encounter during software development. They are essential for understanding the .NET architecture and useful for solving ordinary problems that we face when designing any piece of software. In this chapter, we will look at the implementation of some design patterns. It is worth mentioning that this book does not explain all the known patterns we can use. The focus here is to explain the importance of studying and applying them.In this chapter, we will cover the following topics:

  • Understanding design patterns and their purpose
  • Learning some design patterns...

Summary

In this chapter, we understood why design patterns help with the maintainability and reusability of the parts of the system you are building. We also looked at some typical use cases and code snippets that you can use in your projects. Finally, we presented .NET Generic Host, which is a good example of how .NET uses design patterns to enable code reusability and enforce best practices.All this content will help you while architecting new software or even maintaining an existing one, since design patterns are already-known solutions for some real-life problems in software development.In Chapter 7Understanding the Different Domains in Software Solutions, we will cover the domain-driven design approach. We will also learn how to use the SOLID design principles so that we can map different domains to our software solutions.

Questions

  1. What are design patterns?
  2. What is the difference between design patterns and design principles?
  3. When is it a good idea to implement the Builder pattern?
  4. When is it a good idea to implement the Factory pattern?
  5. When is it a good idea to implement the Singleton pattern?
  6. When is it a good idea to implement the Proxy pattern?
  7. When is it a good idea to implement the Command pattern?
  8. When is it a good idea to implement the Publisher/Subscriber pattern?
  9. When is it a good idea to implement the Dependency Injection pattern?

Further reading

The following are some books and websites where you can find out more regarding what was covered in this chapter:

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Software Architecture with C# 12 and .NET 8 - Fourth Edition
Published in: Feb 2024Publisher: PacktISBN-13: 9781805127659
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Gabriel Baptista

Gabriel Baptista has been working with software development since the beginning of .NET. Today, his main contributions are managing numerous projects for retail and industry. He is an Azure Platform-as-a-Service (PaaS) solution specialist, teaches at Computing Engineering universities, and helps tech startups as a mentor.
Read more about Gabriel Baptista

author image
Francesco Abbruzzese

Francesco Abbruzzese dedicates his life to his two great passions: software and powerlifting. He is the author of the MVC Controls Toolkit and the Blazor Controls Toolkit libraries. He has contributed to the diffusion and evangelization of the Microsoft web stack since the first version of ASP.NET. His company, Mvcct Team, offers web applications, tools, and services for web technologies. He has moved from AI systems, where he implemented one of the first decision support systems for financial institutions, to top-10 video game titles such as Puma Street Soccer.
Read more about Francesco Abbruzzese