In DDD Architecture, where do I store helper classes?

I work in a DDD project that contains these layers: user interface, application, domain, and infrastructure.

Where should helper classes live?

Update:

I am talking about an assistant to self-management facilities.

+3
source share
3 answers

It depends on what kind of assistant you are talking about.

If it is an assistant that formats the value in a friendly display format, then it will be better suited to the user interface. If you are talking about the SqlServer helper, then it goes to Infra.

+2
source

Classes like [Something]Helper , [Something]Manager and [Something]Util are too general and often indicate that no one thought about the correct name and responsibility. They tend to grow over time, accumulating random code fragments. Therefore, instead of finding the right place for your “assistant,” you should probably rename it, and it will become clear whether they belong to the infrastructure or somewhere else.

Note that each .NET object already has a diagnostic and logging method. Thus, you may not need the “Coupe Assistant”:

ToString is for general display and debugging purposes.

+3
source

Assuming Infra stands for Infrastructure , where.

+1
source

Source: https://habr.com/ru/post/898379/


All Articles