On 21 March 2018 at 08:37, dragoncity <dragoncitybrett@gmail.com> wrote:
I had already defined & accepted defaultSpec , as per page 6.
Attached is my CustomerSatisfaction.st file : I assume Pharo will suck it back in !
You've defined this as an instance method, not a class method. If what I've said doesn't make sense, let us know and we can point you to a description (which I don't have handy). One tip: Assuming you're using Pharo 6, in the System Browser, roughly in the middle is a "Class" button. Pressing that will show you the class methods. HTH, Alistair
On 21/03/18 17:55, Alistair Grant wrote:
On 21 March 2018 at 03:12, dragoncity <dragoncitybrett@gmail.com> wrote:
Hello, I'm just getting into Pharo, and am trying to do the example 'tutorial' UI programs in chapter 2 of The Spec UI Framework book. I have a special interest in end user GUI interfaces for programs. I enter the first example code as written and the methods are all accepted without errors. And yes, I did generate the accessors.
However , on attempting to execute the code at the bottom of page 6 from the latest Spec UI Framework book,
| ui |
ui := CustomerSatisfaction newopenWithSpec.
ui close.
this error message appears, no UI image appears of course.
"SubclassResponsibility:CustomerSatisfaction class had the subclass responsibility to implement #defaultSpec"
======
Not only don't I understand the message, but it implies I have to write something called #defaultSpec !, which is not mentioned in the tutorial.
CustomerSatisfaction is a subclass of ComposableModel (ComposablePresenter in Pharo 7). If you have a look at the implementation of #defaultSpec in ComposableModel or ComposablePresenter (depending on which version of Pharo you are using) it says that it is up to subclasses to implement the method (#subclassResponsibility). Since you haven't defined it (yet), the call to #defaultSpec uses the inherited definition from ComposableModel, which raises the error you are seeing.
CustomerSatisfaction class>>defaultSpec is on page 6 of my version of the booklet, dated Feb 6, 2107.
Cheers, Alistair
-- Cheers, Brett