[Seaside] A new critical blog discussing Seaside - Using getters/setters

TheSmalltalkBlog at gmx.ch TheSmalltalkBlog at gmx.ch
Sat Apr 18 20:00:08 UTC 2009


>This sounds, to me at least, to be suggesting that an accessor should be
 > implemented only if you want to expose that "implementation detail" for
 > use by other objects. Am I misinterpreting the statement?

Not the implementation detail but the accessibility of an instvar. I meant 
that I want an accessor implemented whenever the accessibility of an 
instVar should be granted to outside senders. Other way around: Is an 
instVar internal then it's acceptable NOT to have an accessor. 

See the example I gave about instVar fields in WARequest:

1) In the current implementation external classes say:
aRequest fields at: #someValue -> very bad! 

It spreads knowledge about over foreign classes. That cannot be seriously 
considered acceptable Smalltalk style! This requires others to know the 
implementation details of fields in WARequest. Violates encapsulation 
badly1

2) I proposed either of these:
a) aRequest fieldsAt: #someValue      -> well, ok, ca vas
b) aRequest get: #someValue            -> much better
c) aRequest someValue                      -> best of 
all
where the third one has the advantage that the implementation of the 
storage of this symbol inside WARequest is even better hidden. We have 
implemented b) and c) depending on the situation.

Please read my post!

In my experience it happens only in very rare cases that one (or I here) 
wants to hide the instVar values from the outside. But one should always 
hide the implementation details! This is frequently not the case in 
Seaside.

See my post "Proposal 4: Class WARequest". It comprises of 9 concrete 
proposals and only this one was discussed here. Not to mention the other 
proposals. And still no comment at all on failing to document!

A bad sign proving how little open minded most contributors are on this 
list. Unfortunately!



-------- Original-Nachricht --------
> Datum: Sat, 18 Apr 2009 15:29:00 -0400
> Von: Richard Peirson <richardpeirson at gmail.com>
> An: Seaside - general discussion <seaside at lists.squeakfoundation.org>
> Betreff: Re: [Seaside] A new critical blog discussing Seaside - Using 
    getters/setters

> I agree entirely with the points being made by both Michael and Frank on
> this topic.
> 
> In fact, based upon this quote taken from Mr. Cucumber's Proposal #1 in
> his
> Blog, it appears that he does too . . .
> 
> 7) Accessors for other internals
> Of course, the same as stated in 6) is true for all other instances held
> by
> WARequest in its instances. It is never good to let foreigners (classes
> outside WARequest) know about implementation details inside another 
class!
> To reming [sic] you: This is what is called encapsulation in the
> schooldays
> for Smalltalk.
> 
> This sounds, to me at least, to be suggesting that an accessor should be
> implemented only if you want to expose that "implementation detail" for
> use
> by other objects. Am I misinterpreting the statement?
> 
> On Sat, Apr 18, 2009 at 3:05 PM, <TheSmalltalkBlog at gmx.ch> wrote:
> 
> > Once again:
> >
> > There is no performance difference between accessors and direct
> instVars!
> >
> > Was all tested by us many years ago, because this issue was brought up
> as a
> > concern. Even dicts for instVars don't really make a difference (very
> little
> > impact and no practical issue compared to the advantages). All for VW
> only.
> >
> >
> > -------- Original-Nachricht --------
> > > Datum: Sat, 18 Apr 2009 20:55:20 +0200
> > > Von: Claus Kick <claus_kick at web.de>
> > > An: Seaside - general discussion <seaside at lists.squeakfoundation.org>
> > > Betreff: Re: [Seaside] A new critical blog discussing Seaside -
> > Using   getters/setters
> >
> > >
> > > How much difference does the extra method send make in VW, speedwise?
> Is
> > > this measureable somehow?
> >
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> allen:
> > http://www.gmx.net/de/go/multimessenger01
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
    
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20090418/30248cc5/attachment.htm


More information about the seaside mailing list