Y > On 26 Jan 2022, at 15:55, gettimothy via Pharo-users > <pharo-users@lists.pharo.org> wrote: > > WAIPSessionTrackingStrategy > isAbstract > ^true > has just ran into my new hobby horse. > > I am reading through every class in Seaside to document it and I had an > 'aha!' moment > > on the design of Abstract super classes like WABrush: > > WABrush > isAbstract > > ^ self == WABrush > > > The simplicity is genius because no subclass of WABrush has to implement > isAbstract, whereas in WAIPSessionTrackingStrategy, concrete subclasses (of > which there currently are none) will have to. >
Exactly, that is the idea of the pattern. On the downside it is not easy to understand (you have to think about it the first time you see it) and it feels (to me) “ugly”. Maybe because it encodes meta-data of the class, which should be declarative, as a method? Instead of improving the meta-model (and thus our understanding) of what a class is? But it is the best we have now. There is even a “make class abstract” refactoring method in Pharo10, and we adapted the Code Critique to not complain about the direct class reference for these methods. > In defense of the WAIPSessionTrackingStrategy implementation, the comment > reads: > I track sessions using the remote address of a client. > Usually you don't want to use this because it causes troubles when multiple > users share the same IP (eg. several users from the same company). > > That's why I'm marked as abstract. > > There are some special cases like crawlers where it can work though. > > So, apparently, the author is anticipating somebody someday using it. > Maybe you can add an issue to the seaside issue tracker? Marcus