1

Does it make sense to have classes that only have static methods extend each other? Is it good/bad practice?       

class A {
  static baz(){}
  static doStuff(){}       
}

class B extends A {
    static foo(){}
    static bar(){}
}

class C extends B {
  static another(){}
}

I assume this was done so that C can be imported and then

C.baz() and C.foo() 

are readily available, but it just doesn't seem clean.

moon
  • 640
  • 6
  • 14
glasspill
  • 1,290
  • 4
  • 21
  • 36
  • But it's how you should call static methods. – moon Nov 29 '17 at 10:18
  • @moon what do you mean? I know that's how to call static methods, the question is if it's a good design pattern, or if declaring objects with function properties would be better. as in, does it make sense to use classes that contain nothing more than static members or if this is abusing the new class feature. – glasspill Nov 29 '17 at 10:21
  • This might be helpful, https://stackoverflow.com/questions/7694501/class-vs-static-method-in-javascript – moon Nov 29 '17 at 10:24

0 Answers0