title
stringlengths
3
46
content
stringlengths
0
1.6k
Answers:44
Roslyn is the .NET compiler that’s used for code analysis inside Visual Studio.
Answers:45
Code analysis is a practice that considers the way code is written to detect bad practices before compilation.
Answers:46
Code analysis can find problems that happen even with apparently good software, such as memory leaks and bad programming practices.
Answers:47
Roslyn is an engine that provides an API that enables analyzers to inspect your code for style, quality, maintainability, design, and other issues. This is done during design time, so you can check the mistakes before compiling your code.
Answers:48
Visual Studio extensions are tools that have been programmed to run inside Visual Studio. These tools can help you out in some cases where the Visual Studio IDE doesn’t have the appropriate feature for you to use.
Answers:49
SonarLint and the SonarAnalyzer.CSharp NuGet package.
Answers:50
Answers:51
Chapter 5
Answers:52
Answers:53
Copy-and-paste is an inadequate form of code reuse, since it leads to duplicated code, making maintenance and updates more difficult. In fact, there is no safe way to discover all duplicates, and then it is very difficult to modify all of them.
Answers:54
The best approaches for code reuse are creating libraries, using generics, object-oriented inheritance, and more.
Answers:55
Yes. You can find components that have already been created in the libraries you’ve created before, and then you increase these libraries by creating new components that can be reused in the future.
Answers:56
.NET Standard is a specification that allows compatibility across different .NET frameworks, from .NET Framework to Unity. .NET Core is one .NET implementation of .NET and is open source.
Answers:57
By creating a .NET Standard library, you will be able to use it in different .NET implementations, such as .NET Core, .NET, .NET Framework, and Xamarin.
Answers:58
You can enable code reuse using object-oriented principles (e.g., inheritance, encapsulation, abstraction, and polymorphism).
Answers:59
Generics is a sophisticated implementation that simplifies how objects with the same characteristics are treated, by defining a placeholder that will be replaced with the specific type at compile time.
Answers:60
The answer to this question is well explained by Immo Landwerth on the .NET blog: https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/. The basic answer is that .NET versions 5 and above need to be thought of as the foundation for sharing code moving forward.
Answers:61
The challenges related to refactoring include ensuring that changes don’t introduce bugs, maintaining the functionality and performance of code, and improving readability and maintainability without altering the external behavior of software components.
Answers:62
Answers:63
Chapter 6
Answers:64
Answers:65
Design patterns are good solutions to common problems in software development.
Answers:66
While design patterns give you code implementation for typical problems we face in development, design principles help you select the best options when it comes to implementing the software architecture.
Answers:67
The Builder pattern will help you generate sophisticated objects without the need to define them in the class you are going to use them in.
Answers:68
The Factory pattern is useful in situations where you have multiple kinds of objects from the same abstraction, and you don’t know which of them needs to be created at compile time.
Answers:69
The Singleton pattern is useful when you need a class that has only one instance during the software’s execution.
Answers:70
The Proxy pattern is used when you need to provide an object that controls access to another object.
Answers:71
The Command pattern is used when you need to execute a command that will affect the behavior of an object.
Answers:72
The Publisher/Subscriber pattern is useful when you need to provide information about an object to a group of other objects.
Answers:73
The DI pattern is useful if you want to implement the Inversion of Control principle. Instead of creating instances of the objects that the component depends on, you just need to define their dependencies, declare their interfaces, and enable the reception of the objects by injection. Typically, you can do this by using the constructor of the class to receive the objects, tagging some class properties to receive the objects, or defining an interface with a method to inject all the necessary components.
Answers:74
Answers:75
Chapter 7
Answers:76
Answers:77
Changes in the language used by experts and changes in the meaning of words.
Answers:78
Context mapping is the main tool used to coordinate the development of a separate bounded context, helping to define and manage interactions between different contexts.
Answers:79
No; the whole communication passes through the entity, that is, the aggregate root.
Answers:80
There is a single aggregate root in a part-subpart hierarchy to ensure the consistency of and enforce rules across all elements of the aggregate, acting as the main entry point for external interactions.
Answers:81
Just one, since repositories are aggregate-centric.
Answers:82
The application layer manipulates repository interfaces. Repository implementations are registered in the dependency injection engine.
Answers:83
To coordinate operations on several aggregates in single transactions.
Answers:84
The specifications for updates and queries are usually quite different, especially in simple CRUD systems. The reason for its strongest form is mainly the optimization of query response times.
Answers:85
Dependency injection.
Answers:86
No; a serious impact analysis must be performed so that we can adopt it.
Answers:87
Answers:88
Chapter 8
Answers:89
Answers:90
DevOps is the approach of delivering value to the end user continuously. To do this with success, continuous integration, continuous delivery, and continuous feedback must be undertaken.
Answers:91
Continuous integration (CI) allows you to check the quality of the software you are delivering every single time you commit a change. You can implement this by turning on this feature in Azure DevOps.
Answers:92
Continuous delivery (CD) allows you to deploy a solution once you are sure that all the quality checks have passed the tests you designed. Azure DevOps helps you with that by providing you with relevant tools.
Answers:93
Yes, you can have DevOps separately and then enable CI later. You can also have CI enabled without CD enabled. Your team and process need to be ready and attentive for this to happen.
Answers:94
You might confuse CI with a CD process, which could cause damage to your production environment. In the worst-case scenario, for example, a feature that is not ready might be deployed, causing disruptions at inconvenient times for your customers, or you could even suffer a bad collateral effect due to an incorrect fix.
Answers:95
A multi-stage environment protects production from bad releases when fully automated build and deployment pipelines are in place.
Answers:96
Automated tests anticipate bugs and bad behaviors in preview scenarios.
Answers:97
Pull requests allow code reviews before commits are made in the master branch.
Answers:98
No; pull requests can help you in any development approach where you have Git as your source control.
Answers:99
Continuous feedback is the adoption of tools in the DevOps life cycle that enable fast feedback when it comes to performance, usability, and other aspects of the application you are developing.
Answers:100
The build pipeline will let you run tasks to build and test your application, while the release pipeline will give you the opportunity to define how the application will be deployed in each scenario.
Answers:101
Application Insights is a helpful tool for monitoring the health of the system you’ve deployed, which makes it a fantastic continuous feedback tool.
Answers:102
Test and Feedback is a tool that allows stakeholders to analyze the software you are developing and enables a connection with Azure DevOps to open tasks and even bugs.
Answers:103
The main goal of service design thinking is to enhance user experience and satisfaction by optimizing the service’s usability, efficiency, and effectiveness in meeting user needs.
Answers:104
Azure DevOps is a tool that can automate the whole application life cycle when it comes to software development. However, many software architects tend to also use GitHub to do so, and Microsoft has developed the platform a lot in the last few years.
Answers:105
Answers:106
Chapter 9
Answers:107
Answers:108
Because most of the tests must be repeated after any software change occurs.
Answers:109
Because the probability of the same error occurring in a unit test and its associated application code is very low.
Answers:110
[Theory] is used when the test method defines several tests, while [Fact] is used when the test method defines just one test.
Answers:111
Assert.
Answers:112
Setup, Returns, and ReturnsAsync.
Answers:113
Yes, with ReturnAsync.
Answers:114
No; it depends on the complexity of the user interface and how often it changes.
Answers:115
The ASP.NET Core pipeline isn’t executed, but inputs are passed directly to controllers.
Answers:116
Usage of the Microsoft.AspNetCore.Mvc.Testing NuGet package.
Answers:117
Usage of the AngleSharp NuGet package.
Answers:118
Answers:119
Chapter 10
Answers:120
Answers:121
IaaS is a good option when you are migrating from an on-premises solution or if you have an infrastructure team.
Answers:122
PaaS is the best option for fast and safe software delivery in systems where the team is focused on software development.
Answers:123
If the solution you intend to deliver is provided by a well-known player, such as a SaaS, you should consider using it.
Answers:124
Serverless is an option when you are building a new system if you don’t have people who specialize in infrastructure and you don’t want to worry about it for scaling.
Answers:125
Azure SQL Database can be up in minutes, and you will have all the power of Microsoft SQL Server afterward. Moreover, Microsoft will handle the database server infrastructure.
Answers:126
Azure provides a set of services called Azure Cognitive Services. These services provide solutions for vision, speech, language, search, and knowledge.
Answers:127
In a hybrid scenario, you have the flexibility to decide on the best solution for each part of your system, while respecting the solution’s development path in the future.
Answers:128
Answers:129
Chapter 11
Answers:130
Answers:131
The modularity of code and deployment modularity.
Answers:132
No. Other important advantages include handling the development team and the whole CI/CD cycle well, and the possibility of mixing heterogeneous technologies easily and effectively.
Answers:133
A library that helps us implement resilient communication.
Answers:134
Once you’ve installed Docker on your development machine, you can develop, debug, and deploy Dockerized .NET applications. You can also add Docker images to Service Fabric applications that are handled with Visual Studio.
Answers:135
Orchestrators are software that manages microservices and nodes in microservice clusters. Azure supports two relevant orchestrators: Azure Kubernetes Service and Azure Service Fabric.
Answers:136
Because it decouples the actors that take place in a communication.
Answers:137
A message broker. It takes care of service-to-service communication and events.
Answers:138
The same message can be received several times because the sender doesn’t receive confirmation of reception before its time-out period, so the sender resends the message again. Therefore, the effect of receiving a single message once or several times must be the same.
Answers:139
Answers:140
Chapter 12
Answers:141
Answers:142
Redis is a distributed in-memory storage based on key-value pairs and supports distributed queuing. Its most well-known usage is for distributed caching, but it can be used as an alternative to relational databases, since it is able to persist data to disk.
Answers:143
Yes, they are. Most of this chapter’s sections are dedicated to explaining why.