In DDD Architecture where do I keep helper classes?

前端 未结 3 1846
孤街浪徒
孤街浪徒 2021-01-20 13:09

I\'m working in a DDD project where contains these layers: UI, Application, Domain and Infrastructure.

Where should the helpers classes live?

Update:

3条回答
  •  难免孤独
    2021-01-20 13:45

    Classes like [Something]Helper, [Something]Manager and [Something]Util are too generic and often indicate the fact that nobody really thought about a proper name and their responsibility. They tend to grow over time accumulating random pieces of code. So instead of finding the right place for your 'Helper' you should probably rename it and it will become clear whether they belong to Infrastructure or elsewhere.

    Note that every .NET object already has a method for diagnostics and logging. So you may not need 'Object Dumper Helper':

    ToString is intended to be used for general display and debugging purposes.

提交回复
热议问题