Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Software Architecture with C# 9 and .NET 5
Software Architecture with C# 9 and .NET 5

Software Architecture with C# 9 and .NET 5: Architecting software solutions using microservices, DevOps, and design patterns for Azure , Second Edition

Arrow left icon
Profile Icon Gabriel Baptista Profile Icon Francesco Abbruzzese
Arrow right icon
€31.99 €46.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (14 Ratings)
eBook Dec 2020 700 pages 2nd Edition
eBook
€31.99 €46.99
Paperback
€57.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Gabriel Baptista Profile Icon Francesco Abbruzzese
Arrow right icon
€31.99 €46.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (14 Ratings)
eBook Dec 2020 700 pages 2nd Edition
eBook
€31.99 €46.99
Paperback
€57.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€31.99 €46.99
Paperback
€57.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Software Architecture with C# 9 and .NET 5

Non-Functional Requirements

Once you have gathered the system requirements, it is time to think about the impact they have on the architectural design. Scalability, availability, resiliency, performance, multithreading, interoperability, security, and other subjects need to be analyzed so that we can meet user needs. We refer to these aspects as non-functional requirements.

The following topics will be covered in this chapter:

  • How do .NET 5 and Azure enable scalability, availability, and resiliency?
  • Performance issues that need to be considered when programming in C#
  • Software usability, that is, how to design effective user interfaces
  • .NET 5 and interoperability
  • Achieving security by design
  • Book use case – understanding the main types of .NET Core projects

Technical requirements

The samples provided in this chapter will require Visual Studio 2019 Community Edition with .NET 5 SDK installed.

You can find the sample code for this chapter at https://github.com/PacktPublishing/Software-Architecture-with-C-9-and-.NET-5.

Enabling scalability, availability, and resiliency with Azure and .NET 5

A short search on scalability returns a definition such as the ability of a system to keep working well when there is an increase in demand. Once developers read this, many of them incorrectly conclude that scalability only means adding more hardware to keep things working without stopping the app.

Scalability relies on technologies involving hardware solutions. However, as a software architect, you must be aware that good software will keep scalability in a sustainable model, which means that a well-architected software can save a lot of money. Hence, it is not just a matter of hardware but also a matter of overall software design. The point here is that the running cost of a system should also be a factor in the architectural decisions.

In Chapter 1, Understanding the Importance of Software Architecture, while discussing software performance, we proposed some good tips to overcome bad performance issues...

Performance issues that need to be considered when programming in C#

Nowadays, C# is one of the most commonly used programming languages all over the world, so good tips about C# programming are fundamental for the design of good architectures that satisfy the most common non-functional requirements.

The following sections mention a few simple but effective tips – the associated code samples are available in the GitHub repository of this book.

String concatenation

This is a classic one! A naive concatenation of strings with the + string operator may cause serious performance issues since each time two strings are concatenated, their contents are copied into a new string.

So, if we concatenate, for instance, 10 strings that have an average length of 100, the first operation has a cost of 200, the second one has a cost of 200+100=300, the third one has a cost of 300+100=400, and so on. It is not difficult to convince yourself that the overall cost grows like m...

Usability – why inserting data takes too much time

Scalability, performance tips, and multithreading are the main tools we can use to tune machine performance. However, the effectiveness of the system you design depends on the overall performance of the whole processing pipeline, which includes both humans and machines.

As a software architect, you cannot improve the performance of humans, but you can improve the performance of man-machine interaction by designing an effective user interface (UI), that is, a user interface that ensures fast interaction with humans, which, in turn, means the following:

  • The UI must be easy to learn in order to reduce the time that is needed for learning and time wasting before the target users learn to operate it quickly. This constraint is fundamental if UI changes are frequent, and for public websites that need to attract the greatest possible number of users.
  • The UI must not cause any kind of slowdown in data insertion...

The fantastic world of interoperability with .NET Core

.NET Core brought Windows developers the ability to deliver their software into various platforms. And you, as a software architect, need to pay attention to this. Linux and macOS are no longer a problem for a C# lover – it is much better than that – they are great opportunities to deliver to new customers. Therefore, we need to ensure performance and multi-platform support, two common non-functional requirements in several systems.

Both console applications and web apps designed with .NET Core in Windows are almost completely compatible with Linux and macOS, too. This means you do not have to build the app again to run it on these platforms. Also, very platform-specific behaviors now have multi-platform support, as shown, for instance, by the System.IO.Ports.SerialPort class, which, starting from .NET Core 3.0, is on Linux.

Microsoft offers scripts to help you install .NET Core on Linux and macOS. You can...

Achieving security by design

As we have seen up to here in the book, the opportunities and techniques we have for developing software are incredible. If you add all the information you will read about in relation to cloud computing in the next chapters, you will see that the opportunities just increase, as does the complexity to maintain all of this computing environment.

As a software architect, you must understand that these opportunities come with many responsibilities. The world has changed a lot in the last years. The second decade of the 21st century has required lots of technology. Apps, social media, Industry 4.0, Big Data, and artificial intelligence are no longer future objectives, but mainly current projects that you will lead and deal with in your routine.

Considering this scenario, security must have a different approach. The world has moved to regulate companies that manage personal data. For instance, GDPR – the General Data Protection Regulation –...

Book use case – understanding the main types of .NET Core projects

The development of this book's use case will be based on various kinds of .NET Core Visual Studio projects. This section describes all of them. Let us select New project in the Visual Studio File menu.

You can filter .NET Core project types by typing in the search engine, as follows:

Figure 2.19: Searching types of .NET Core projects in Visual Studio

There, you will find common C# projects (console, a class library, Windows Form, WPF), and various types of test projects, each based on a different test framework: xUnit, NUnit, and MSTest. Choosing among the various testing frameworks is just a matter of preference since all of them offer comparable features. Adding tests to each piece of software that composes a solution is a common practice and allows software to be modified frequently without jeopardizing its reliability.

You may also want to define your class library projects under...

Summary

Functional requirements that describe system behavior must be completed with non-functional requirements that constrain system performance, scalability, availability, resilience, interoperability, usability, and security.

Performance requirements come from response time and system load requirements. As a software architect, you should ensure you have the required performance at the minimum cost, building efficient algorithms and taking full advantage of the available hardware resources with multithreading.

Scalability is the ability of a system to be adapted to an increasing load. Systems can be scaled vertically by providing more powerful hardware, or horizontally by replicating and load balancing the same hardware, which increases the availability. The cloud, in general, and Azure can help us implement strategies dynamically, with no need to stop your application.

Tools such as .NET Core that run on several platforms can ensure interoperability, that is, the...

Questions

  1. Which are the two conceptual ways to scale a system?
  2. Can you deploy your web app automatically from Visual Studio to Azure?
  3. What is multithreading useful for?
  4. What are the main advantages of the asynchronous pattern over other multithreading techniques?
  5. Why is the order of input fields so important?
  6. Why is the .NET Core Path class so important for interoperability?
  7. What is the advantage of a .NET standard class library over a .NET Core class library?
  8. List the various types of .NET Core Visual Studio projects.
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Gain fundamental and comprehensive software architecture knowledge and the skillset to create fully modular apps
  • Design high-performance software systems using the latest features of .NET 5 and C# 9
  • Solve scalability problems in web apps using enterprise architecture patterns

Description

Software architecture is the practice of implementing structures and systems that streamline the software development process and improve the quality of an app. This fully revised and expanded second edition, featuring the latest features of .NET 5 and C# 9, enables you to acquire the key skills, knowledge, and best practices required to become an effective software architect. This second edition features additional explanation of the principles of Software architecture, including new chapters on Azure Service Fabric, Kubernetes, and Blazor. It also includes more discussion on security, microservices, and DevOps, including GitHub deployments for the software development cycle. You will begin by understanding how to transform user requirements into architectural needs and exploring the differences between functional and non-functional requirements. Next, you will explore how to carefully choose a cloud solution for your infrastructure, along with the factors that will help you manage your app in a cloud-based environment. Finally, you will discover software design patterns and various software approaches that will allow you to solve common problems faced during development. By the end of this book, you will be able to build and deliver highly scalable enterprise-ready apps that meet your organization’s business requirements.

Who is this book for?

This book is for engineers and senior software developers aspiring to become architects or looking to build enterprise applications with the .NET Stack. Basic familiarity with C# and .NET is required to get the most out of this book.

What you will learn

  • Use different techniques to overcome real-world architectural challenges and solve design consideration issues
  • Apply architectural approaches such as layered architecture, service-oriented architecture (SOA), and microservices
  • Leverage tools such as containers, Docker, Kubernetes, and Blazor to manage microservices effectively
  • Get up to speed with Azure tools and features for delivering global solutions
  • Program and maintain Azure Functions using C# 9 and its latest features
  • Understand when it is best to use test-driven development (TDD) as an approach for software development
  • Write automated functional test cases
  • Get the best of DevOps principles to enable CI/CD environments

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 28, 2020
Length: 700 pages
Edition : 2nd
Language : English
ISBN-13 : 9781800565173
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 28, 2020
Length: 700 pages
Edition : 2nd
Language : English
ISBN-13 : 9781800565173
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 157.97
Software Architecture with C# 9 and .NET 5
€57.99
An Atypical ASP.NET Core 5 Design Patterns Guide
€36.99
C# 9 and .NET 5 – Modern Cross-Platform Development
€62.99
Total 157.97 Stars icon
Banner background image

Table of Contents

25 Chapters
Understanding the Importance of Software Architecture Chevron down icon Chevron up icon
Non-Functional Requirements Chevron down icon Chevron up icon
Documenting Requirements with Azure DevOps Chevron down icon Chevron up icon
Deciding the Best Cloud-Based Solution Chevron down icon Chevron up icon
Applying a Microservice Architecture to Your Enterprise Application Chevron down icon Chevron up icon
Azure Service Fabric Chevron down icon Chevron up icon
Azure Kubernetes Service Chevron down icon Chevron up icon
Interacting with Data in C# – Entity Framework Core Chevron down icon Chevron up icon
How to Choose Your Data Storage in the Cloud Chevron down icon Chevron up icon
Working with Azure Functions Chevron down icon Chevron up icon
Design Patterns and .NET 5 Implementation Chevron down icon Chevron up icon
Understanding the Different Domains in Software Solutions Chevron down icon Chevron up icon
Implementing Code Reusability in C# 9 Chevron down icon Chevron up icon
Applying Service-Oriented Architectures with .NET Core Chevron down icon Chevron up icon
Presenting ASP.NET Core MVC Chevron down icon Chevron up icon
Blazor WebAssembly Chevron down icon Chevron up icon
Best Practices in Coding C# 9 Chevron down icon Chevron up icon
Testing Your Code with Unit Test Cases and TDD Chevron down icon Chevron up icon
Using Tools to Write Better Code Chevron down icon Chevron up icon
Understanding DevOps Principles Chevron down icon Chevron up icon
Challenges of Applying CI Scenarios Chevron down icon Chevron up icon
Automation for Functional Tests Chevron down icon Chevron up icon
Answers Chevron down icon Chevron up icon
Another Book You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(14 Ratings)
5 star 71.4%
4 star 7.1%
3 star 7.1%
2 star 7.1%
1 star 7.1%
Filter icon Filter
Top Reviews

Filter reviews by




Dusty Wright Jan 24, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book covers software architecture on the Microsoft stack. I was looking for an up-to-date book that included C# 9, .NET 5, & Azure. It begins with user requirements and finishes with CI/CD production software in Azure. The reader is placed in the software architect role. Enterprise architecture design concerns are addressed. Options available in .NET 5 and Azure are considered. There are rich resources at the end of each chapter. This book is a benchmark for current practice and gives insight into Azure development. I recommend this book.My highlights include:✔️ Design thinking constructed user stories from user & system requirements✔️ CI/CD scalable microservice-based architecture using Docker containers✔️ Microservices orchestration tools with Azure Service Fabric & Kubernetes✔️ SOLID principles, Design Patterns, and DDD in an ASP.NET Core MVC app✔️ Case study project uses a modern application development life cycle approach
Amazon Verified review Amazon
Brian Barnett Jan 09, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As software architects there are many aspects to an enterprise, distributed system to consider – not just the code. This book gives you a great introduction to the next step along your software development journey, including the proper principles, processes, techniques and technology needed to architect a modern cloud-based, distributed system. While the concepts are generally applicable, this book gives practical examples in context of the .NET and Azure ecosystem.After reading this book will you be an expert .NET software architect? No. That will take time to achieve. In fact each chapter could be, and usually is, a book by itself. However, what I like about this book is it summarizes in a single coherent place a great overview of the topics that are scattered across various sources.When you finish the book you will have the broad spectrum of knowledge required to be a software architect. Think of the book as a map, guiding you along this journey … and Gabriel and Francesco are experienced guides, not only telling you where to go but why, which is just as if not more important.To help they created a case study project, World Wide Travel Club, that is used throughout the book to concretely demonstrate topics. Also there are questions at the end of each chapter to help test your knowledge and lots of references for further reading.I’m not sure the Azure Service Fabric chapter was needed. Service Fabric is a great service orchestrator and was the original Azure service orchestrator. But Kubernetes has won the service orchestrator war and is now the defacto standard now for orchestrating distributed services, especially given its open source, cross-platform support the importance of this chapter is diminished. Even Microsoft is starting to move some of their services from Service Fabric to Kubernetes. Microsoft Teams is one example. I would have used the space to expand on a few more topics.From analysis, design, agile/scrum, cloud and microservice architectures, serverless, Kubernetes, data access, distributed storage, design patterns, domain-driven design, code reuse, REST APIs, Blazor WebAssembly, testing, dev ops, you can’t go wrong with this book.Highly recommended! I’m going to recommend it to the dev teams I work with.A great complimentary book is Mark J. Price’s book C# 9 and .NET 5 – Modern Cross-Platform Development.
Amazon Verified review Amazon
Michael C. Gamble Jan 21, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
“Software Architecture with C#9 and .NET 5” is an excellent overall book for people writing enterprise software. Chapter 5 Applying a Microservice Architecture to Your Enterprise Application was especially pertinent for me. My project, which is not Enterprise as such, is a Mobile app that needs reliability and zero downtime. I had read enough to know I was going to need microservices. But how to get started architecting the overall design was giving me some problems. Where to start? I had thought of using Azure, and I would need to have every element be a Microsoft solution. Now I’ve changed my outlook some and now am behind using Container using a Web API solution on the backend to supply data and services for my Xamarin mobile application.I also found the section on REST service authorization right on point. I was hacking through many REST examples, just trying to see what is in an authorization header? I’ve been Playing around with Azure Functions, knowing how to set up the call to get the API-Key into the string. They also take pains to explain why in .NET 5, Microsoft abandoned WCF. Reading on, I got very interested in gRPC as a more efficient way to move data.The book is for beginning Software Architects. An excellent soup to nuts and lots and lots of further reading at the end of each chapter. Far too often, you get different seeming unrelated factoids of enterprise programming. This book takes all those pieces and gives you a context to get those pieces working together to make a robust bullet-proof system that gets the job done.
Amazon Verified review Amazon
Domenico Bove Jan 24, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The new chapters on Kubernetes and Blazor alone are worth the price of the new edition. It was the first time I completed an introduction to Kubernetes. After months of attempts, I finally learned the basics of Kubernetes and felt confident I can go ahead with this technology: an easy to understand and well-organized treatment of the subject. Everything else I tried was full of complications and overwhelming details. Highly recommended also if you already bought the previous edition.
Amazon Verified review Amazon
Andre P. Jan 17, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a great resource for anybody who wants to learn how to develop apps in the cloud using Microsoft Azure. Throughout the book you'll learn how to build a simple travel app on Azure by leveraging different approaches and services. I also really like that a large portion of the book is dedicated to foundational topics like distributed architectures and software development methodologies which are always important regardless of the particular technology used to build apps.Here are some highlights:✔️Understand different distributed architectures (SOA, microservices, serverless)✔️Learn about Azure services✔️Explore the most common software development methodologies (Agile, XP, Scrum)✔️Learn to design an app: functional and non-functional requirements✔️Experiment with different web app technologies (ASP.NET, Blazor)✔️Understand development best practices (design patterns, modularized code, TDD, DevOps/CICD)
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.