Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Software Architecture with C# 9 and .NET 5 - Second Edition
Software Architecture with C# 9 and .NET 5 - Second Edition

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

By Gabriel Baptista , Francesco Abbruzzese
€45.99 €31.99
Book Dec 2020 700 pages 2nd Edition
eBook
€45.99 €31.99
Print
€58.99
Subscription
€14.99 Monthly
eBook
€45.99 €31.99
Print
€58.99
Subscription
€14.99 Monthly

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
Buy Now

Product Details


Publication date : Dec 28, 2020
Length 700 pages
Edition : 2nd Edition
Language : English
ISBN-13 : 9781800566040
Category :
Table of content icon View table of contents Preview book icon Preview Book

Software Architecture with C# 9 and .NET 5 - Second Edition

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.

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

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
Buy Now

Product Details


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

Table of Contents

26 Chapters
Preface Chevron down icon Chevron up icon
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

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
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.