Architecture and Principles Flashcards
What is Dapper?
Dapper is a lightweight and high-performance Object-Relational Mapping (ORM) library for .NET applications, allowing efficient database access using simple SQL queries.
How does Dapper differ from other ORMs?
Dapper focuses on simplicity and performance by mapping database query results directly to objects without much overhead.
Is Dapper suitable for complex data models?
Yes, Dapper can handle complex data models effectively by using multi-mapping and query composition techniques.
Can Dapper handle stored procedures?
Yes, Dapper can work with stored procedures by using the Query, QueryMultiple, and Execute methods.
Does Dapper support async operations?
Yes, Dapper provides asynchronous methods for executing queries and commands, which can enhance application responsiveness.
In which scenarios is Dapper most beneficial?
Dapper shines in scenarios where you need high-performance data access, like read-heavy applications or reporting systems.
How can parameterized queries be executed using Dapper?
Dapper supports parameterized queries by passing an anonymous type or a strongly-typed object to the query methods.
What’s the role of Dapper’s SqlMapper class?
SqlMapper is the core class in Dapper that provides extension methods for database operations and query mapping.
Is Dapper open-source?
Yes, Dapper is an open-source project maintained by the Stack Exchange team.
Can Dapper be used with non-relational databases?
While Dapper is primarily designed for relational databases, it might work with non-relational databases, but its design is better suited for SQL-based systems.
What is Clean Architecture?
Clean Architecture is a software design principle that emphasizes separation of concerns and the independence of business logic from external frameworks and tools.
What are the core components of Clean Architecture?
Clean Architecture consists of layers such as Entities, Use Cases, Interface Adapters, and Frameworks & Drivers.
Why is Dependency Inversion Principle important in Clean Architecture?
Dependency Inversion Principle promotes decoupling and modularity by allowing high-level modules to depend on abstractions, not concrete implementations
How does Clean Architecture improve maintainability?
Clean Architecture enforces a clear separation between business rules and external dependencies, making it easier to modify or replace specific components without affecting others.
What is the purpose of the “Entities” layer in Clean Architecture?
The Entities layer holds business entities, enterprise-wide business rules, and application-specific logic.
Explain the role of the “Use Cases” layer.
The Use Cases layer contains application-specific use cases and business logic, representing the application’s core functionality.
What are “Interface Adapters” in Clean Architecture?
Interface Adapters convert data between the use cases and the external world, including controllers, presenters, and gateways.
How does Clean Architecture facilitate automated testing?
Clean Architecture’s separation of concerns allows you to test each layer in isolation, enabling thorough unit and integration testing.
Is Clean Architecture suitable for small projects?
Clean Architecture’s benefits become more apparent in larger projects, but its principles can be scaled down for smaller applications as well.
Can Clean Architecture be applied to any programming language?
Yes, Clean Architecture’s principles can be adapted to various programming languages and technologies.
What is Hexagonal Architecture (a.k.a. Ports and Adapters)?
Hexagonal Architecture is a design pattern that focuses on creating a flexible and maintainable system by isolating core business logic from external dependencies.
Why is it called “Hexagonal” Architecture?
The architecture is named after the shape of the diagram, where the core application logic is in the center, surrounded by “ports” and “adapters.”
What are the “ports” in Hexagonal Architecture?
Ports are interfaces that define the interaction points between the application and the external world, such as input and output operations.
What are “adapters” in this context?
Adapters are implementations of the ports, responsible for translating external requests into calls to the core application and vice versa.