0

In my app I'm using a single class that holds the configuration for some process. Now, I'm trying to break it in smaller peaces, as you can see in the class diagram below:

enter image description here

  1. Do you think this design pattern is ok?
  2. What about the FilterOnOff class?
  3. Should I use structs? In this case I will not be able to derive from FilterOnOff to get the "Acttive" state.
Digbyswift
  • 10,310
  • 4
  • 38
  • 66
Pedro77
  • 5,176
  • 7
  • 61
  • 91

1 Answers1

1

Just guess, that you split class manager of configuration into smaller pieces, in order to be able to persist a smaller piece of configuration of some specific entity, and not all information, which is probably not relevant to that entity.

In this case:

  1. Don't see serious problems, also cause it's difficult to say something really useful, cause depends how your app is structured.

  2. If you think that the shared domain of the properties in your case consist of single Active property, it's ok.

  3. No, do not use structs. Structs can be useful, for example, to boost a performance in several cases, as stack allocation is really fast. For configuration management it's not a case. Use full flexibility which given to you by reference types in C#.

Hope this helps.

Tigran
  • 61,654
  • 8
  • 86
  • 123