Using Business Logic Classes in C# with .NET MAUI

Tom Meier 260 Reputation points
2024-12-06T20:05:12.9933333+00:00

What are the best practices for creating business logic classes in C# for a bank application? Specifically, how do business logic classes interact with data access classes, and how can expression-bodied members be utilized in this context?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,547 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,763 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,152 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 68,486 Reputation points
    2024-12-07T22:19:49.1666667+00:00

    The business logic, database logic and UI should be loosely coupled. You should use the adapter pattern for the business logic to interact with data access layer and the UI. Your layers should expose interfaces. I away create explicit request / response models for each layer.

    https://www.dofactory.com/net/adapter-design-pattern

    you also might be interest in the orchestration, Choreography, or saga patterns to manage the interactions.

    https://jamiemaguire.net/index.php/2017/05/06/simplify-your-architecture-using-the-orchestrator-pattern/

    https://microservices.io/patterns/data/saga.html

    https://learn.microsoft.com/en-us/azure/architecture/patterns/choreography

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.