Genability / genability-js

Node.js and Browser Javascript SDK for Genability APIs.
MIT License
0 stars 2 forks source link

Gen 1999 tou list #262

Closed mgerring closed 3 years ago

mgerring commented 3 years ago

One issue I had with this that's beyond my current OOP knowledge — what's the benefit of BasePagedRequest being abstract, in the event that we need to use it on its own like we are here? Would it be better for BasePagedRequest to just be usable as is, instead of being an abstract class?

andrewfister commented 3 years ago

@mgerring The usefulness of an abstract class in my mind is basically that the abstract method you have to implement is useful to be implemented nearly all the time and to make the user of the class think about how that part of the functionality works. If that abstract method is being implemented as a no-op repeatedly, it doesn't make sense to continue structuring the class that way. Just implement the no-op in the base class and make it not abstract anymore.

andrewfister commented 3 years ago

@mgerring However, looking at the usages of BasePagedRequest, it seems like the abstract class is a useful feature in this case, as most classes are using the addParams in a unique way each time