Software Architecture with C# 9 and .NET 5
eBook - ePub

Software Architecture with C# 9 and .NET 5

Architecting software solutions using microservices, DevOps, and design patterns for Azure, 2nd Edition

  1. 700 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Software Architecture with C# 9 and .NET 5

Architecting software solutions using microservices, DevOps, and design patterns for Azure, 2nd Edition

Book details
Book preview
Table of contents
Citations

About This Book

Design scalable and high-performance enterprise applications using the latest features of C# 9 and.NET 5

Key Features

  • 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

Book 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

Who this book is 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.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Software Architecture with C# 9 and .NET 5 by Gabriel Baptista, Francesco Abbruzzese in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in C#. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9781800565173
Edition
2

15

Presenting ASP.NET Core MVC

In this chapter, you will learn how to implement an application presentation layer. More specifically, you will learn how to implement a web application based on ASP.NET Core MVC.
ASP.NET Core is a .NET framework for implementing web applications. ASP.NET Core has been partially described in previous chapters, so this chapter will focus mainly on ASP.NET Core MVC. More specifically, this chapter will cover the following topics:
  • Understanding the presentation layers of web applications
  • Understanding the ASP.NET Core MVC structure
  • What is new in the latest versions of ASP.NET Core?
  • Understanding the connection between ASP.NET Core MVC and design principles
  • Use case – implementing a web app in ASP.NET Core MVC
We will review and give further details on the structure of the ASP.NET Core framework, which, in part, was discussed in Chapter 14, Applying Service-Oriented Architectures with .NET Core, and Chapter 4, Deciding the Best Cloud-Based Solution. Here, the main focus is on how to implement web-based presentation layers based on the so-called Model View Controller (MVC) architectural pattern.
We will also analyze all of the new features available in the last ASP.NET Core 5.0 version, as well as the architectural patterns included in the ASP.NET Core MVC framework and/or used in typical ASP.NET Core MVC projects. Some of these patterns were discussed in Chapter 11, Design Patterns and .NET 5 Implementation, and Chapter 12, Understanding the Different Domains in Software Solutions, whereas some others, such as the MVC pattern itself, are new.
You will learn how to implement an ASP.NET Core MVC application, as well as how to organize the whole Visual Studio solution, by going through a practical example at the end of this chapter. This example describes a complete ASP.NET Core MVC application for editing the packages of the WWTravelClub book use case.

Technical requirements

This chapter requires the free Visual Studio 2019 Community edition or better with all database tools installed.
All the concepts in this chapter will be clarified with practical examples based on the WWTravelClub book use case. The code for this chapter is available at https://github.com/PacktPublishing/Software-Architecture-with-C-9-and-.NET-5.

Understanding the presentation layers of web applications

This chapter discusses an architecture for implementing the presentation layers of web-based applications based on the ASP.NET Core framework. The presentation layers of web applications are based on three techniques:
  • Mobile or desktop native applications that exchange data with servers through REST or SOAP services: We have not discussed them since they are strictly tied to the client device and its operating system. Therefore, analyzing them, which would require a dedicated book, is completely beyond the scope of this book.
  • Single-Page Applications (SPAs): These are HTML-based applications whose dynamic HTML is created on the client either in JavaScript or with the help of WebAssembly (a kind of cross-browser assembly that can be used as a high-performance alternative to JavaScript). Like native applications, SPAs exchange data with the server through REST or SOAP services, but they have the advantage of being independent of the device and its operating system since they run in a browser. Chapter 16, Blazor WebAssembly, describes the Blazor SPA framework, which is based on WebAssembly, since it is based itself on a .NET runtime compiled in WebAssembly.
  • HTML pages created by the server whose content depends on the data to be shown to the user: The ASP.NET Core MVC framework, which will be discussed in this chapter, is a framework for creating such dynamic HTML pages.
The remainder of this chapter focuses on how to create HTML pages on the server side and, more specifically, on ASP.NET Core MVC, which will be introduced in the next section.

Understanding the ASP.NET Core MVC structure

ASP.NET Core is based on the concept of the Generic Host, as explained in the Using generic hosts subsection of Chapter 5, Applying a Microservice Architecture to Your Enterprise Application. The basic architecture of ASP.NET Core was outlined in the A short introduction to ASP.NET Core subsection of Chapter 14, Applying Service-Oriented Architectures with .NET Core.
It is worth reminding you that the host configuration is delegated to the Startup class defined in the Startup.cs file by calling the .UseStartup<Startup>() method of the IWebHostBuilder interface. ConfigureServices(IServiceCollection services) of the Startup class defines all services that can be injected into object constructors through Dependency Injection (DI). DI was described in detail in the Using generic hosts subsection of Chapter 5, Applying a Microservice Architecture to Your Enterprise Application.
On the other hand, the Configure(IApplicationBuilder app, IWebHostEnvironment env) startup method defines the so-called ASP.NET Core pipeline, which was briefly described in the A short introduction to ASP.NET Core subsection of Chapter 14, Applying Service-Oriented Architectures w...

Table of contents

  1. Preface
  2. Understanding the Importance of Software Architecture
  3. Non-Functional Requirements
  4. Documenting Requirements with Azure DevOps
  5. Deciding the Best Cloud-Based Solution
  6. Applying a Microservice Architecture to Your Enterprise Application
  7. Azure Service Fabric
  8. Azure Kubernetes Service
  9. Interacting with Data in C# – Entity Framework Core
  10. How to Choose Your Data Storage in the Cloud
  11. Working with Azure Functions
  12. Design Patterns and .NET 5 Implementation
  13. Understanding the Different Domains in Software Solutions
  14. Implementing Code Reusability in C# 9
  15. Applying Service-Oriented Architectures with .NET Core
  16. Presenting ASP.NET Core MVC
  17. Blazor WebAssembly
  18. Best Practices in Coding C# 9
  19. Testing Your Code with Unit Test Cases and TDD
  20. Using Tools to Write Better Code
  21. Understanding DevOps Principles
  22. Challenges of Applying CI Scenarios
  23. Automation for Functional Tests
  24. Answers
  25. Another Book You May Enjoy
  26. Index