3

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

Where should the helpers classes live?

Update:

I'm talking about a Object Dumper Helper for example.

Richard
  • 4,740
  • 4
  • 32
  • 39
Acaz Souza
  • 8,311
  • 11
  • 54
  • 97

3 Answers3

4

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.

Dmitry
  • 17,078
  • 2
  • 44
  • 70
  • I'd say it is because your point is valid but does not propose a clear solution. After reading this I'm still confused on how to name the "helper" or where to place it. – Maarten Bicknese Jan 09 '17 at 14:51
2

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

If it's a Helper that format a value in a friendly display format, then it would fit better in the UI. If you are talking about a SqlServer helper, then it goes to Infra.

goenning
  • 6,514
  • 1
  • 35
  • 42
  • 1
    I see. For me, object dumper is for debugging/development/log purpose and has nothing to do with the UI nor domain, so, I would throw it inside Infra. – goenning Sep 15 '11 at 19:44
1

Assuming Infra stands for Infrastructure, that's where.

Oded
  • 489,969
  • 99
  • 883
  • 1,009