Antwort: Mixed feelings
Sergei Gnezdov
sergei-gnezdov-pub at pobox.com
Sun Jun 9 03:26:57 UTC 2002
At 6/7/02 +0200 06:40 PM, Kamil Kukura wrote:
>Boris_Gaertner at msg.de wrote:
>>Kamil wrote about his impressions and posed some questions.
>>Here are remarks to some of his questions:
>> >>For example, Object understands so many methods that I doubt it still
>> >>stands for basic building stone.
>>I agree that the Object protocol became huge over time. Methods like
>>#beep are not really necessary, but they are convenient.
>
>And it will be bigger by time. For example, existence of method
>Object>>asHtmlDocumentForRequest: indicates that we can just expect more
>and more selectors being added as productivity goes on. I was thinking
>about idea of good protocol category description and then having selective
>inheritance so that a class would inherit either all or some (selected by
>protocol categories list) methods from superclass.
I don't know a lot about smalltalk so I can't use smalltalk language here.
My first impression of Squeak was: Object is too big. It is too big! It
holds too much.
Only UI objects can beep. Not every object wants to know how to present
itself in HTML.
Look at what happens if somebody will add ability to every object to
persist itself into SQL database.
Some people create object persistence via introduction of read, write,
delete operations on the objects which are persisted somewhere. I don't
think there are a lot of people here to argue that it is bad. In order to
persist object we introduce 3rd party named persistence layer. It knows
how to persist objects. There is a default policy to persist any object on
the system. In order to take control over persistence process a particular
object may implement a certain interface/protocol to tell persistence layer
what should be written and what should not be.
The same is about Object>>asHtmlDocument... The default policy is
implemented in a third party class. Default policy uses reflection to do
its work on any object in the system.
It is easy to choose an easy way to add new functionality via new call to
Object, but it is not the most correct way.
I don't want to cause a lot of flame here, but Java is a very good example
in this case. Java object is small.
Thank you
More information about the Squeak-dev
mailing list
|