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

Reply via email to