concept abstraction in category .net

appears as: bstractions, bstraction, Abstraction, n abstraction, abstraction, Abstractions, ABSTRACTIONS, ABSTRACTION
Concurrency in .NET

This is an excerpt from Manning's book Concurrency in .NET.

In this book I’ll look at considerations and challenges for writing concurrent multithreaded applications in a traditional programming paradigm. I’ll explore how to successfully address these challenges and avoid concurrency pitfalls using the functional paradigm. Next, I’ll introduce the benefits of using abstractions in functional programming to create declarative, simple-to-implement, and highly performant concurrent programs. Over the course of this book, we’ll examine complex concurrent issues providing an insight into the best practices necessary to build concurrent and scalable programs in .NET using the functional paradigm. You’ll become familiar with how functional programming helps developers support concurrency by encouraging immutable data structures that can be passed between threads without having to worry about a shared state, all while avoiding side effects. By the end of the book you’ll master how to write more modular, readable, and maintainable code in both C# and F# languages. You’ll be more productive and proficient while writing programs that function at peak performance with fewer lines of code. Ultimately, armed with your newfound skills, you’ll have the knowledge needed to become an expert at delivering successful high-performance solutions.

Abstraction is a pillar of FP, which allows you to develop an application without worrying about the implementation details, allowing you to focus on the more important high-level semantics of the program. Essentially, abstraction captures the core of what a function or a whole program does, making it easier to get things done.

Dependency Injection in .NET

This is an excerpt from Manning's book Dependency Injection in .NET.

Figure 1.12. The Hello DI application from section 1.2 contains a SEAM between the Salutation and ConsoleMessageWriter classes because the Salutation class only writes through the ABSTRACTION of the IMessageWriter interface.

Each option represents a different algorithm, and the application may treat each routing algorithm as an ABSTRACTION so it can treat them all equally. To calculate a route, the application needs a routing algorithm, but it doesn’t care which one. We must tell it which algorithm it should use, but we don’t know this until runtime, because it’s based on the user’s choice.

Figure 6.7. Cycles in the dependency graph can occur even if the ABSTRACTIONS have no relations to each other. In this example, each implementation implements a separate interface but also requires a DEPENDENCY. Because ConcreteC requires IA, but the only implementation of IA is ConcreteA with its DEPENDENCY on IB and so forth, we have a cycle that can’t be resolved as is.
  • Hiding the entire connection management logic behind an ABSTRACTION