[Pharo-users] Re: We haven't had a design debate in a while - thoughts on CD.buy article...

2021-04-29 Thread Erik Stel
Hi people,

A bit late to the party, but I want to provide some info as well.

I think an Article can perfectly respond to a #sell (or #sellQuantity:)
message. Depending on the type of application it could know or interact with
other objects responsible for Stock for example to provide an estimated
delivery date and price. When a customer is not known through some context
it could be #sellToCustomer: or #sellToAccount:. But mostly to have a
delivery address and make sure payment is done. Not to have a customer do
the buying (as an act), that is irrelevant for most (web)shops.

There is often no need to have a person like object to fulfil the role of
actor (dare I say 'manager') in the object interactions. Objects have
behaviour and take on responsibilities of their own. Having a human like
object moves responsibilities away from the objects and creates unneeded
dependencies between objects. You'll quickly see conditional logic appear in
those classes.

Kids sometimes understand this way of looking at objects better than we
adults. A kid does not find it weird to see a movie or play in which a
teapot pours itself or where a CD plays itself.

So I do understand that a CD understands #play as a message. Perfectly fine.
We do not literally have to represent every physical object and its physical
characteristics in our world as objects in our applications. It is the
behaviour and responsibilities they posses that counts. (CRC cards are
really quite helpful in OO)

I highly recommend reading the book Object Thinking by Dave West. For sake
of clarity: yes, we are partners in ObjectGuild. See the link to the book
below. Don't be put back by the age of the book.

http://davewest.us/product/object-thinking/

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html


[Pharo-users] Re: creating a subclass in system browser

2021-04-29 Thread Richard O'Keefe
I hadn't actually noticed the "+" sign but it was there in V7 and is there
in V9 on Windows.

On Wed, 28 Apr 2021 at 03:15, Sanjay Minni  wrote:

> Don't think it's there in v9. Check in v8
>
> On Tue, 27 Apr, 2021, 7:50 pm Russ Whaley,  wrote:
>
>> Can you send a screenshot of the plus button?  I'm using v9 on MacOS and
>> I don't see a class + button...
>>
>> On Tue, Apr 27, 2021 at 9:47 AM kmo  wrote:
>>
>>> Doing it by hand is fiddly and error-prone. I know - because that's the
>>> way I
>>> used to do it before I realised that the plus button at the top of the
>>> browser bottom panel did it for me. (I had no idea that there was also a
>>> menu option on the refactorings menu). I think you might find the button
>>> to
>>> be the better way - I did.
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>>>
>>
>>
>> --
>> Russ Whaley
>> whaley.r...@gmail.com
>>
>