Code critics: 'Method defined in all subclasses, but not in superclass'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Code critics: 'Method defined in all subclasses, but not in superclass'

laura
Hi all,

If i run Critic Browser on a package with just a class that defines a method as subclassResponsibility and two subclasses that override it, i get under group 'Design Flaws'  'Method defined in all subclasses, but not in superclass'. If instead of 'self subclassResponsibility' i write anything else the critic doesn't show. Is this the expected behaviour? So, is considered an error to have a superclass without a default implementation (not subclassResponsibility) for a method?

You can get example package sending
Gofer new smalltalkhubUser: 'squidik' project: 'samples'; package: 'Critics'; load.

Best,
Laura
Reply | Threaded
Open this post in threaded view
|

Re: Code critics: 'Method defined in all subclasses, but not in superclass'

Marcus Denker-4

> On 26 Mar 2015, at 23:15, Laura Risani <[hidden email]> wrote:
>
> Hi all,
>
> If i run Critic Browser on a package with just a class that defines a method as subclassResponsibility and two subclasses that override it, i get under group 'Design Flaws'  'Method defined in all subclasses, but not in superclass'. If instead of 'self subclassResponsibility' i write anything else the critic doesn't show. Is this the expected behaviour? So, is considered an error to have a superclass without a default implementation (not subclassResponsibility) for a method?
>
> You can get example package sending
> Gofer new smalltalkhubUser: 'squidik' project: 'samples'; package: 'Critics'; load.
>

I think in Pharo3 there was a bug in this rule that we fixed in Pharo4… I checked your package in Pharo4, and the error is correctly not found.

        Marcus


Reply | Threaded
Open this post in threaded view
|

Re: Code critics: 'Method defined in all subclasses, but not in superclass'

laura
It's true in v4 is already fixed :)

On Fri, Mar 27, 2015 at 4:53 AM, Marcus Denker <[hidden email]> wrote:

> On 26 Mar 2015, at 23:15, Laura Risani <[hidden email]> wrote:
>
> Hi all,
>
> If i run Critic Browser on a package with just a class that defines a method as subclassResponsibility and two subclasses that override it, i get under group 'Design Flaws'  'Method defined in all subclasses, but not in superclass'. If instead of 'self subclassResponsibility' i write anything else the critic doesn't show. Is this the expected behaviour? So, is considered an error to have a superclass without a default implementation (not subclassResponsibility) for a method?
>
> You can get example package sending
> Gofer new smalltalkhubUser: 'squidik' project: 'samples'; package: 'Critics'; load.
>

I think in Pharo3 there was a bug in this rule that we fixed in Pharo4… I checked your package in Pharo4, and the error is correctly not found.

        Marcus