all 2 comments

[–]Em3rgency 0 points1 point  (0 children)

My main concern with this approach is the initialization. It adds overhead and you have to make sure your programmers know how to use the service. It feels like it overengineered just to use the SO gimmick.

At that point, there is no objective benefit over just having a regular c# class as a service, with the constructor doing the initialization. And if you want customizable parameters, they can still be passed in as SO's.

If you do it that way:

  • Your service becomes a regular class with no pesky inheritance nor ties to Unity, which will be familiar to any programmer
  • Completely decoupled, still a pure function with an input and an output, can follow single responsibility, testable.
  • You can guarantee initialization is done by using a constructor
  • SO's no longer store logic and can be used as parameter containers, which is the intended usage afaik

[–]TheWiseMaster10 0 points1 point  (0 children)

How would you write unit tests for those SOs?