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
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (14 Ratings)
Paperback Dec 2020 700 pages 2nd Edition
eBook
$42.99 $61.99
Paperback
$76.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Gabriel Baptista Profile Icon Francesco Abbruzzese
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (14 Ratings)
Paperback Dec 2020 700 pages 2nd Edition
eBook
$42.99 $61.99
Paperback
$76.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$42.99 $61.99
Paperback
$76.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781800566040
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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
$279.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 $ 208.97
Software Architecture with C# 9 and .NET 5
$76.99
An Atypical ASP.NET Core 5 Design Patterns Guide
$48.99
C# 9 and .NET 5 – Modern Cross-Platform Development
$82.99
Total $ 208.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.