Architecture and Principles Flashcards

1
Q

What is Dapper?

A

Dapper is a lightweight and high-performance Object-Relational Mapping (ORM) library for .NET applications, allowing efficient database access using simple SQL queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does Dapper differ from other ORMs?

A

Dapper focuses on simplicity and performance by mapping database query results directly to objects without much overhead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is Dapper suitable for complex data models?

A

Yes, Dapper can handle complex data models effectively by using multi-mapping and query composition techniques.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can Dapper handle stored procedures?

A

Yes, Dapper can work with stored procedures by using the Query, QueryMultiple, and Execute methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does Dapper support async operations?

A

Yes, Dapper provides asynchronous methods for executing queries and commands, which can enhance application responsiveness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In which scenarios is Dapper most beneficial?

A

Dapper shines in scenarios where you need high-performance data access, like read-heavy applications or reporting systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can parameterized queries be executed using Dapper?

A

Dapper supports parameterized queries by passing an anonymous type or a strongly-typed object to the query methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s the role of Dapper’s SqlMapper class?

A

SqlMapper is the core class in Dapper that provides extension methods for database operations and query mapping.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Is Dapper open-source?

A

Yes, Dapper is an open-source project maintained by the Stack Exchange team.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Can Dapper be used with non-relational databases?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Clean Architecture?

A

Clean Architecture is a software design principle that emphasizes separation of concerns and the independence of business logic from external frameworks and tools.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the core components of Clean Architecture?

A

Clean Architecture consists of layers such as Entities, Use Cases, Interface Adapters, and Frameworks & Drivers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is Dependency Inversion Principle important in Clean Architecture?

A

Dependency Inversion Principle promotes decoupling and modularity by allowing high-level modules to depend on abstractions, not concrete implementations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does Clean Architecture improve maintainability?

A

Clean Architecture enforces a clear separation between business rules and external dependencies, making it easier to modify or replace specific components without affecting others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of the “Entities” layer in Clean Architecture?

A

The Entities layer holds business entities, enterprise-wide business rules, and application-specific logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain the role of the “Use Cases” layer.

A

The Use Cases layer contains application-specific use cases and business logic, representing the application’s core functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are “Interface Adapters” in Clean Architecture?

A

Interface Adapters convert data between the use cases and the external world, including controllers, presenters, and gateways.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does Clean Architecture facilitate automated testing?

A

Clean Architecture’s separation of concerns allows you to test each layer in isolation, enabling thorough unit and integration testing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Is Clean Architecture suitable for small projects?

A

Clean Architecture’s benefits become more apparent in larger projects, but its principles can be scaled down for smaller applications as well.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Can Clean Architecture be applied to any programming language?

A

Yes, Clean Architecture’s principles can be adapted to various programming languages and technologies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is Hexagonal Architecture (a.k.a. Ports and Adapters)?

A

Hexagonal Architecture is a design pattern that focuses on creating a flexible and maintainable system by isolating core business logic from external dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Why is it called “Hexagonal” Architecture?

A

The architecture is named after the shape of the diagram, where the core application logic is in the center, surrounded by “ports” and “adapters.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the “ports” in Hexagonal Architecture?

A

Ports are interfaces that define the interaction points between the application and the external world, such as input and output operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are “adapters” in this context?

A

Adapters are implementations of the ports, responsible for translating external requests into calls to the core application and vice versa.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

How does Hexagonal Architecture improve testability?

A

By decoupling the core logic from external dependencies, testing becomes easier as you can mock or replace adapters during testing.

26
Q

Can Hexagonal Architecture be applied to monolithic applications only?

A

No, Hexagonal Architecture principles can be applied to both monolithic and microservices architectures to achieve modularity.

27
Q

Does Hexagonal Architecture add complexity to development?

A

While there’s an initial overhead in setting up the architecture, it often reduces complexity in the long run by making the system more maintainable and adaptable.

28
Q

Is Hexagonal Architecture suitable for every project?

A

Hexagonal Architecture is particularly beneficial for complex applications, where maintaining separation between core logic and external concerns is crucial.

29
Q

How does Hexagonal Architecture aid in technology changes?

A

The core logic remains unchanged when adapting to new technologies, as only the adapters need to be adjusted to work with new frameworks or tools.

30
Q

Are there any real-world examples of projects using Hexagonal Architecture?

A

Yes, projects like CQRS-based systems, domain-driven design implementations, and microservices architectures often adopt Hexagonal Architecture principles.

31
Q

What are microservices?

A

Microservices is an architectural approach where an application is composed of loosely coupled, independently deployable services that communicate over a network.

32
Q

What’s the key benefit of microservices?

A

Microservices enable scalability, maintainability, and agility by breaking down an application into smaller, manageable services.

33
Q

How do microservices communicate with each other?

A

Microservices often use lightweight communication mechanisms like HTTP/REST, message queues, or event-driven architectures.

34
Q

What challenges can arise in microservices around data consistency?

A

Maintaining data consistency across distributed services can be challenging; solutions include event sourcing, distributed transactions, and eventual consistency.

35
Q

What’s the difference between monolithic and microservices architectures?

A

Monolithic architectures have all components within a single codebase, while microservices split functionalities into separate services.

36
Q

Can microservices be built using different programming languages?

A

Yes, microservices can be built using various programming languages and technologies, as long as the services can communicate effectively.

37
Q

How does microservices architecture impact deployment and scaling?

A

Microservices can be deployed and scaled independently, allowing for more efficient resource allocation and better responsiveness.

38
Q

What is the role of API gateways in microservices?

A

API gateways handle routing, authentication, load balancing, and sometimes aggregation of requests for various microservices.

39
Q

What are the challenges of testing in microservices?

A

Testing can become complex due to the distributed nature of microservices; strategies like contract testing and service virtualization can help.

40
Q

Is there a relationship between microservices and containerization?

A

Yes, containerization technologies like Docker are often used to package microservices along with their dependencies for consistency in different environments.

41
Q

What is Domain-Driven Design (DDD)?

A

Domain-Driven Design is a software design approach that focuses on aligning software models with the real-world domain, enhancing collaboration between technical and domain experts

42
Q

Why is domain knowledge crucial in DDD?

A

Domain knowledge helps in creating a shared understanding between developers and domain experts, leading to more accurate and effective software models.

43
Q

What is the core concept of a “domain model” in DDD?

A

A domain model represents the core business logic and rules of an application, capturing essential concepts, behaviors, and relationships.

44
Q

How does DDD handle complex business rules?

A

DDD provides techniques like aggregates, value objects, and entities to encapsulate and manage complex business rules within the domain model.

45
Q

What is an “aggregate” in DDD?

A

An aggregate is a cluster of domain objects treated as a single unit for data changes, ensuring consistency and integrity.

46
Q

What’s the difference between “entities” and “value objects” in DDD?

A

Entities have identity and are distinguishable, while value objects do not have identity and are immutable representations of concepts.

47
Q

What are “repositories” in DDD?

A

Repositories provide an abstraction for accessing and managing aggregates, helping to maintain a clean separation between domain logic and data access.

48
Q

How does DDD approach tackling ubiquitous language?

A

Ubiquitous language refers to using a common vocabulary between developers and domain experts; DDD encourages modeling software using this shared language.

49
Q

What is the role of “bounded contexts” in DDD?

A

Bounded contexts define specific boundaries where a certain model is valid; they help avoid ambiguity when different models use the same terms differently.

50
Q

Can DDD be used with any programming language or technology?

A

Yes, DDD’s principles can be applied to various programming languages and technologies, making it adaptable to different contexts.

51
Q

What is CQRS (Command Query Responsibility Segregation)?

A

CQRS is a design pattern that separates read and write operations into distinct paths, optimizing the data model and processing for each operation.

52
Q

What problem does CQRS address

A

CQRS helps solve scalability and performance challenges by allowing separate optimization of read-heavy and write-heavy parts of an application.

53
Q

How does CQRS affect the data store?

A

CQRS often leads to different storage solutions for reads and writes, enabling each storage mechanism to be tailored to its specific usage.

54
Q

What is a “command” in CQRS?

A

A command represents an intention to change the state of the system; it’s responsible for updating data and enforcing business rules.

55
Q

What is a “query” in CQRS?

A

A query represents a request to retrieve data from the system; it’s focused on reading and displaying information without modifying the state.

56
Q

Does adopting CQRS lead to eventual consistency?

A

Yes, CQRS can result in eventual consistency since writes and reads occur separately, potentially causing a delay in data synchronization.

57
Q

Are there any challenges associated with CQRS implementation?

A

CQRS introduces complexity due to managing the divergence between read and write models, as well as maintaining synchronization.

58
Q

Is CQRS suitable for every application?

A

CQRS is beneficial for applications with complex or varying read and write requirements, while simpler applications might not require its overhead.

59
Q

Can CQRS be used in conjunction with other architectural patterns?

A

Yes, CQRS can be combined with other patterns like Event Sourcing and DDD to create a comprehensive solution for complex applications.

60
Q

How does CQRS affect the user experience?

A

CQRS might lead to slightly different views of data for readers compared to writers, which could impact user expectations and understanding of the system’s behavior.