Gofer versus Installer was: The Trunk: Morphic-laza.489.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Chris Cunnington

     Goofy new
         squeaksource: 'KomHttpServer';
         package: 'KomHttpServer';
         load


Selectors that may possibly have fallen through the cracks:
#goferPriority; #versionNamed:

Chris

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Ken G. Brown
At 3:24 PM -0500 12/16/10, Chris Cunnington apparently wrote:
>    Goofy new
>        squeaksource: 'KomHttpServer';
>        package: 'KomHttpServer';
>        load
>
>
>Selectors that may possibly have fallen through the cracks: #goferPriority; #versionNamed:
>
>Chris

Why do you need Goofy for that?

In the Installer docs From: <http://installer.pbworks.com/w/page/19997682/Installer>
--
Using #monticello (abbreviated form #mc)
 
Monticello repository options:
 
Installer monticello http: aUrl.
Installer monticello http: aUrl user: name password: secret.
Installer monticello directory: dir
Installer monticello ftp: host directory: dir user: name password: secret.
Installer monticello magma: host port: aport
Installer monticello goods: host port: aport.
Installer monticello directory: stringOrFileDirectory.
 
1) Typical Usage
 
Installer monticello http: 'http://www.squeaksource.com';
     project: 'Seaside';
     install: 'Comet-lr.8';
     install: 'Scriptaculous'.
2) To specify particular package versions/authors to load

Installer monticello http: 'http://www.squeaksource.com';

     project: 'Seaside';
     install: #('Comet-lr' 'Comet-pmm'); "either of these"
     install: 'Scriptaculous-lr.148'. "specific version"
3) When user/password is required
 
Installer monticello http: 'http://www.squeaksource.com';
     user: 'me'; password: 'asecret';
     install: 'something'.
4) Abbreviated instanciation for convenience.
 
Installer squeaksource.
Installer ss.
Installer squeakFoundation.
Installer sf.
Installer lukas.
Installer impara.
Installer wiresong.
--
Ken G. Brown

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Janko Mivšek
In reply to this post by Andreas.Raab
Guys, for Thursday funny: "It is really goofy that some people do not
understand the price-value relationship of classes in object-oriented
systems." http://twitter.com/#!/renggli

Well, I couldn't resist :)
Janko

On 16. 12. 2010 08:19, Andreas Raab wrote:

> Folks -
>
> To illustrate my point about Gofer being an API, here is an
> implementation of the same API. Gofer's little brother -called Goofy-
> provides an implementation of the Gofer API but it's a bit simpler and
> comes in a single class (with a total of 400 LOC or so). It passes most
> of the Gofer tests.
>
> The exercise was actually interesting since it points out several things
> that are just plain broken from the Monticello perspective. I just
> posted a fix for the first issue - a way to get versions and names in a
> consistent way from different repositories. Clearly a thing that should
> be in Monticello.
>
> Another interesting issue is some of the cleanup that is in Gofer and
> pretty much directly replicated in Goofy's #cleanoutWorkingCopy:
> #unloadWorkingCopy: and #unregisterRepositories:. These are all things
> that need to be folded into MCWorkingCopy but I'll leave that for
> another day since I'm a bit tired right now and don't want to
> accidentally break MC in the process :-)
>
> In any case, if you look at Goofy I think you'll see the API much more
> clearly. It's a good API, but it doesn't need to be spread out amongst
> some 20-something classes.
>
> Cheers,
>   - Andreas
>
> On 12/15/2010 9:54 AM, Andreas Raab wrote:
>> On 12/15/2010 9:21 AM, Chris Muller wrote:
>>> One question that came to my mind last night: What does> 1000 lines
>>> of Gofer code bring to Monticello-loading that I can't already do with
>>> just Monticello? or with a couple of facade methods added to plain
>>> MC?
>>
>> I spent the evening yesterday to look at Gofer in detail and it is what
>> led me to say that Gofer is really an API to Monticello, not an
>> installer. First, there is nothing in there that should not be part of
>> Monticello proper; contrary to Installer and Metacello I would expect
>> all the stuff that is in Gofer to be readily available in Monticello
>> itself. Gofer is simply a good facade to Monticello with a useful API.
>>
>> Secondly, much of the code in Gofer comes from the "command pattern gone
>> wild" problem. Gofer simply overuses the command pattern. Every
>> operation is wrapped in a separate class without any need for doing so.
>> As a consequence, things that should be a simple "self foo" become
>> unnecessarily complex in creation, setup, and execution. If you would
>> take this out, it would reduce Gofer to 5 classes or so and the total
>> code size by a significant amount while improving clarity.
>>
>> As an API to Monticello, Gofer is very nice and we should standardize on
>> it. But as a "replacement" for Installer it's not even in the same
>> ballpark.
>>
>> Cheers,
>> - Andreas
>>
>>
>
>
>
>

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Igor Stasenko
2010/12/16 Janko Mivšek <[hidden email]>:
> Guys, for Thursday funny: "It is really goofy that some people do not
> understand the price-value relationship of classes in object-oriented
> systems." http://twitter.com/#!/renggli
>
> Well, I couldn't resist :)

Me too.. me too.
It would be good to hear arguments from other side here.

Personally i don't care how many classes takes an implementation, if
it not forcing me to learn more than i can swallow in order to start
using it productively.

> Janko
>
> On 16. 12. 2010 08:19, Andreas Raab wrote:
>> Folks -
>>
>> To illustrate my point about Gofer being an API, here is an
>> implementation of the same API. Gofer's little brother -called Goofy-
>> provides an implementation of the Gofer API but it's a bit simpler and
>> comes in a single class (with a total of 400 LOC or so). It passes most
>> of the Gofer tests.
>>
>> The exercise was actually interesting since it points out several things
>> that are just plain broken from the Monticello perspective. I just
>> posted a fix for the first issue - a way to get versions and names in a
>> consistent way from different repositories. Clearly a thing that should
>> be in Monticello.
>>
>> Another interesting issue is some of the cleanup that is in Gofer and
>> pretty much directly replicated in Goofy's #cleanoutWorkingCopy:
>> #unloadWorkingCopy: and #unregisterRepositories:. These are all things
>> that need to be folded into MCWorkingCopy but I'll leave that for
>> another day since I'm a bit tired right now and don't want to
>> accidentally break MC in the process :-)
>>
>> In any case, if you look at Goofy I think you'll see the API much more
>> clearly. It's a good API, but it doesn't need to be spread out amongst
>> some 20-something classes.
>>
>> Cheers,
>>   - Andreas
>>
>> On 12/15/2010 9:54 AM, Andreas Raab wrote:
>>> On 12/15/2010 9:21 AM, Chris Muller wrote:
>>>> One question that came to my mind last night: What does> 1000 lines
>>>> of Gofer code bring to Monticello-loading that I can't already do with
>>>> just Monticello? or with a couple of facade methods added to plain
>>>> MC?
>>>
>>> I spent the evening yesterday to look at Gofer in detail and it is what
>>> led me to say that Gofer is really an API to Monticello, not an
>>> installer. First, there is nothing in there that should not be part of
>>> Monticello proper; contrary to Installer and Metacello I would expect
>>> all the stuff that is in Gofer to be readily available in Monticello
>>> itself. Gofer is simply a good facade to Monticello with a useful API.
>>>
>>> Secondly, much of the code in Gofer comes from the "command pattern gone
>>> wild" problem. Gofer simply overuses the command pattern. Every
>>> operation is wrapped in a separate class without any need for doing so.
>>> As a consequence, things that should be a simple "self foo" become
>>> unnecessarily complex in creation, setup, and execution. If you would
>>> take this out, it would reduce Gofer to 5 classes or so and the total
>>> code size by a significant amount while improving clarity.
>>>
>>> As an API to Monticello, Gofer is very nice and we should standardize on
>>> it. But as a "replacement" for Installer it's not even in the same
>>> ballpark.
>>>
>>> Cheers,
>>> - Andreas
>>>
>>>
>>
>>
>>
>>
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Dale Henrichs
I will just mention that for Metacello I found that I needed to extend
Gofer in a couple of key areas and with just a couple of classes and
overriding a method or two, I was able to "bend gofer" to my will:)

In my experience implementations that are written using only a few
classes are more difficult to extend because the key assumptions are
spread throughout the methods rather than isolated in classes ... you
have to copy/modify/maintain a lot of code that is not related to what
you are trying to accomplish...

I haven't looked at the goofy implementation to see how easy it would be
to use from within Metacello I don't need to ... gofer works just fine
for what I need:)

Dale

On 12/16/2010 02:10 PM, Igor Stasenko wrote:

> 2010/12/16 Janko Mivšek<[hidden email]>:
>> Guys, for Thursday funny: "It is really goofy that some people do not
>> understand the price-value relationship of classes in object-oriented
>> systems." http://twitter.com/#!/renggli
>>
>> Well, I couldn't resist :)
>
> Me too.. me too.
> It would be good to hear arguments from other side here.
>
> Personally i don't care how many classes takes an implementation, if
> it not forcing me to learn more than i can swallow in order to start
> using it productively.
>
>> Janko
>>
>> On 16. 12. 2010 08:19, Andreas Raab wrote:
>>> Folks -
>>>
>>> To illustrate my point about Gofer being an API, here is an
>>> implementation of the same API. Gofer's little brother -called Goofy-
>>> provides an implementation of the Gofer API but it's a bit simpler and
>>> comes in a single class (with a total of 400 LOC or so). It passes most
>>> of the Gofer tests.
>>>
>>> The exercise was actually interesting since it points out several things
>>> that are just plain broken from the Monticello perspective. I just
>>> posted a fix for the first issue - a way to get versions and names in a
>>> consistent way from different repositories. Clearly a thing that should
>>> be in Monticello.
>>>
>>> Another interesting issue is some of the cleanup that is in Gofer and
>>> pretty much directly replicated in Goofy's #cleanoutWorkingCopy:
>>> #unloadWorkingCopy: and #unregisterRepositories:. These are all things
>>> that need to be folded into MCWorkingCopy but I'll leave that for
>>> another day since I'm a bit tired right now and don't want to
>>> accidentally break MC in the process :-)
>>>
>>> In any case, if you look at Goofy I think you'll see the API much more
>>> clearly. It's a good API, but it doesn't need to be spread out amongst
>>> some 20-something classes.
>>>
>>> Cheers,
>>>    - Andreas
>>>
>>> On 12/15/2010 9:54 AM, Andreas Raab wrote:
>>>> On 12/15/2010 9:21 AM, Chris Muller wrote:
>>>>> One question that came to my mind last night: What does>  1000 lines
>>>>> of Gofer code bring to Monticello-loading that I can't already do with
>>>>> just Monticello? or with a couple of facade methods added to plain
>>>>> MC?
>>>>
>>>> I spent the evening yesterday to look at Gofer in detail and it is what
>>>> led me to say that Gofer is really an API to Monticello, not an
>>>> installer. First, there is nothing in there that should not be part of
>>>> Monticello proper; contrary to Installer and Metacello I would expect
>>>> all the stuff that is in Gofer to be readily available in Monticello
>>>> itself. Gofer is simply a good facade to Monticello with a useful API.
>>>>
>>>> Secondly, much of the code in Gofer comes from the "command pattern gone
>>>> wild" problem. Gofer simply overuses the command pattern. Every
>>>> operation is wrapped in a separate class without any need for doing so.
>>>> As a consequence, things that should be a simple "self foo" become
>>>> unnecessarily complex in creation, setup, and execution. If you would
>>>> take this out, it would reduce Gofer to 5 classes or so and the total
>>>> code size by a significant amount while improving clarity.
>>>>
>>>> As an API to Monticello, Gofer is very nice and we should standardize on
>>>> it. But as a "replacement" for Installer it's not even in the same
>>>> ballpark.
>>>>
>>>> Cheers,
>>>> - Andreas
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>> --
>> Janko Mivšek
>> AIDA/Web
>> Smalltalk Web Application Server
>> http://www.aidaweb.si
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Andreas.Raab
In reply to this post by Igor Stasenko
On 12/16/2010 2:10 PM, Igor Stasenko wrote:
> 2010/12/16 Janko Mivšek<[hidden email]>:
>> Guys, for Thursday funny: "It is really goofy that some people do not
>> understand the price-value relationship of classes in object-oriented
>> systems." http://twitter.com/#!/renggli
>>
>> Well, I couldn't resist :)
>
> Me too.. me too.
> It would be good to hear arguments from other side here.

Indeed. From my perspective there are some pretty straightforward rules
for when creating additional classes is a good idea.

For example, I am a big fan of Announcements, since they make the set of
events that are part of an application explicit. Even though one can
just use names (i.e., self signalEvent: #foo) having each event be a
separate class is beneficial because a user who doesn't know what events
exist, can find those, can find out where they are signaled, and how
they are used.

Or Exceptions. Another good use for having additional classes. Both for
purposes of documentation (what exceptions exist) as well as for
extending them. For example, I can add a subclass of ConnectionError in
my application and generic handlers for ConnectionError in third party
code will be able to catch the error correctly.

Or the command pattern itself, which is extremely useful in many
situations, like when you need to reason about bulk sets of method
invocations (in undo for example).

So there are indeed various reasons for when adding additional classes
can be very, very beneficial. But let's not forget that there's a cost
associated with it as well. If it were different, if there was really no
cost associated with having a class, how about we make all of the 2000
Morph methods into commands? If there is no cost to it, then it must be
beneficial, right?

So yes, I understand that there's a cost-benefit ratio for adding
additional classes. But if there's a good reason for these classes in
Gofer, then I just don't see it. None of the rules for when additional
classes are a good idea seem to apply. In which case Occam's razor wins.

Now if I only could make that argument in 140 characters... but then no
sensible argument has ever been made on Twitter and none ever will, so
who cares.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Igor Stasenko
On 17 December 2010 02:07, Andreas Raab <[hidden email]> wrote:

> On 12/16/2010 2:10 PM, Igor Stasenko wrote:
>>
>> 2010/12/16 Janko Mivšek<[hidden email]>:
>>>
>>> Guys, for Thursday funny: "It is really goofy that some people do not
>>> understand the price-value relationship of classes in object-oriented
>>> systems." http://twitter.com/#!/renggli
>>>
>>> Well, I couldn't resist :)
>>
>> Me too.. me too.
>> It would be good to hear arguments from other side here.
>
> Indeed. From my perspective there are some pretty straightforward rules for
> when creating additional classes is a good idea.
>
> For example, I am a big fan of Announcements, since they make the set of
> events that are part of an application explicit. Even though one can just
> use names (i.e., self signalEvent: #foo) having each event be a separate
> class is beneficial because a user who doesn't know what events exist, can
> find those, can find out where they are signaled, and how they are used.
>
> Or Exceptions. Another good use for having additional classes. Both for
> purposes of documentation (what exceptions exist) as well as for extending
> them. For example, I can add a subclass of ConnectionError in my application
> and generic handlers for ConnectionError in third party code will be able to
> catch the error correctly.
>
> Or the command pattern itself, which is extremely useful in many situations,
> like when you need to reason about bulk sets of method invocations (in undo
> for example).
>
> So there are indeed various reasons for when adding additional classes can
> be very, very beneficial. But let's not forget that there's a cost
> associated with it as well. If it were different, if there was really no
> cost associated with having a class, how about we make all of the 2000 Morph
> methods into commands? If there is no cost to it, then it must be
> beneficial, right?
>
> So yes, I understand that there's a cost-benefit ratio for adding additional
> classes. But if there's a good reason for these classes in Gofer, then I
> just don't see it. None of the rules for when additional classes are a good
> idea seem to apply. In which case Occam's razor wins.
>
> Now if I only could make that argument in 140 characters... but then no
> sensible argument has ever been made on Twitter and none ever will, so who
> cares.
>

Those who wants to learn and exchange their experience, like me want to see
different argumentation with pro and cons, so we can make some
conclusions and learn something new.

My own ruleset is simple:
It is not necessary to always follow same rules, except two: DRY and KISS.

> Cheers,
>  - Andreas
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Andreas.Raab
On 12/16/2010 5:36 PM, Igor Stasenko wrote:
> Those who wants to learn and exchange their experience, like me want to see
> different argumentation with pro and cons, so we can make some
> conclusions and learn something new.
>
> My own ruleset is simple:
> It is not necessary to always follow same rules, except two: DRY and KISS.

Ah, yes. KISS. But how do we measure simplicity? How about this:

http://squeakingalong.wordpress.com/2010/04/30/measuring-simplicity/

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Gofer versus Installer

Andreas.Raab
In reply to this post by Dale Henrichs
On 12/16/2010 4:37 PM, Dale Henrichs wrote:
> In my experience implementations that are written using only a few
> classes are more difficult to extend because the key assumptions are
> spread throughout the methods rather than isolated in classes ... you
> have to copy/modify/maintain a lot of code that is not related to what
> you are trying to accomplish...

Generally speaking, yes. If you dump everything in a single class or two
then you're going to end up in a mess. However, if most of your classes
end up having a single method or two for no tangible benefit, there's a
bad smell there as well.

> I haven't looked at the goofy implementation to see how easy it would be
> to use from within Metacello I don't need to ... gofer works just fine
> for what I need:)

Abso-freaking-lutely! Let's not forget what this discussion is about. It
is *not* about Gofer vs. Goofy. It's about Gofer versus Installer. And
in this context, I've been trying to make a couple of points with Goofy:

1) Gofer is a thin veneer over Monticello with a better client API. I
think Goofy shows this very clearly, much more clearly than Gofer does.

2) One of the reasons we're having this discussion is because people
feel that Gofer is "sizable" enough that they wouldn't want to have both
Gofer and Installer. But the reality is that Gofer is tiny. The reason
it feels sizable is that it has 20-something classes lingering around
for no particular good reason.

3) Another issue in this this discussion is that Lukas uses Pharo
exclusively and the issue of maintenance has been brought up. Which is
largely a function of complexity. One of the things that Goofy shows is
just how trivial it is to reimplement the API if that were ever needed.

That's it. I am absolutely in favor of having a good client API for
Monticello. I would prefer if the class representing would be called
"MCClient" or "MCClientAPI" instead of "Gofer", but other than that I'm
making an argument *for* Gofer not against it. Unfortunately, people
only hear what they want to hear, so to make really, really sure
everyone is hearing what I'm saying I'll say it five more times:

I want Gofer *in addition to* Installer.
I want Gofer *in addition to* Installer.
I want Gofer *in addition to* Installer.
I want Gofer *in addition to* Installer.
I want Gofer *in addition to* Installer.

Oh, and @Lukas: Sniping from the back seats is never helpful.

Cheers,
   - Andreas

PS. Also, one additional reason for Goofy was that I wasn't sure if
there might be hidden gotchas with the implementation that would turn
out to require the command pattern. I've seen that happening before and
didn't want to be caught with egg on my face :-)

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Janko Mivšek
On 17. 12. 2010 05:55, Andreas Raab wrote:

> On 12/16/2010 4:37 PM, Dale Henrichs wrote:
>> In my experience implementations that are written using only a few
>> classes are more difficult to extend because the key assumptions are
>> spread throughout the methods rather than isolated in classes ... you
>> have to copy/modify/maintain a lot of code that is not related to what
>> you are trying to accomplish...
>
> Generally speaking, yes. If you dump everything in a single class or two
> then you're going to end up in a mess. However, if most of your classes
> end up having a single method or two for no tangible benefit, there's a
> bad smell there as well.

Exactly. Extremes are always bad. And both extremes lower the simplicity
and therefore maintability of the code and specially, comprehendibility
by newcommers. That's why also wanted to show with my code stats
comparison between Aida, Seaside and Iliad:

https://spreadsheets.google.com/ccc?key=0Atnb1W9vuq9ndG4wbUpxNXpKQnFZRlFyQXpHclhZa2c&hl=sl#gid=1

>From "Methods in classes" distribution graph, then from number of
packages and categories you can clearly see two schools of thought here.

I of course claim that Aida "school of thought" with its balanced
distribution of code between methods, classes, categories and packages
is more comprehensible and therefore more simple.

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Chris Muller-3
But let's not temper wild-and-crazy _too_ much.  Classes are just
objects in the system.  I would not want to discourage it if some
really dynamic system that "enhances itself" could be reailized, even
if it resulted in 10 thousand dynamically-generated classes..

Ok, one would think there would be a better organization of behavior,
but a similar point can be made about Tweak. Doesn't it blaze new
trails in its use of Processes and perhaps also pragmas?  (Sorry, it's
been years since I looked at Tweak).

I continue to be amazed at the creative implementations this community
puts out; like Generators and piping and Continuations, etc.



>> Generally speaking, yes. If you dump everything in a single class or two
>> then you're going to end up in a mess. However, if most of your classes
>> end up having a single method or two for no tangible benefit, there's a
>> bad smell there as well.
>
> Exactly. Extremes are always bad. And both extremes lower the simplicity
> and therefore maintability of the code and specially, comprehendibility
> by newcommers. That's why also wanted to show with my code stats
> comparison between Aida, Seaside and Iliad:
>
> https://spreadsheets.google.com/ccc?key=0Atnb1W9vuq9ndG4wbUpxNXpKQnFZRlFyQXpHclhZa2c&hl=sl#gid=1
>
> >From "Methods in classes" distribution graph, then from number of
> packages and categories you can clearly see two schools of thought here.
>
> I of course claim that Aida "school of thought" with its balanced
> distribution of code between methods, classes, categories and packages
> is more comprehensible and therefore more simple.
>
> Best regards
> Janko
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Colin Putney-3
On Fri, Dec 17, 2010 at 3:06 PM, Chris Muller <[hidden email]> wrote:
> But let's not temper wild-and-crazy _too_ much.  Classes are just
> objects in the system.  I would not want to discourage it if some
> really dynamic system that "enhances itself" could be reailized, even
> if it resulted in 10 thousand dynamically-generated classes..

Yeah, I've wrestled with this issue a bit. OmniBrowser uses a
convention where there's a separate class for each menu command. In
the current version of OmniBrowser, with all the RB stuff installed,
there are 167 such classes. They're not dynamically generated, each
one was hand-coded by a contributor.

When I first came up with that design, I thought it was pretty awful,
but I implemented it anyway, as an exercise in reductio ad absurdum,
hoping that I would learn something that would lead me to a better
design. To my surprise it was a massive improvement over the previous
design, and I haven't been able to come up with anything better.

So yeah, I agree that both everything-in-one-class and
many-classes-with-few-methods are both warning signs. OTOH, sometimes
there are good reasons to break this kind of rule of thumb.

Colin

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Andreas.Raab
On 12/17/2010 12:42 PM, Colin Putney wrote:
> Yeah, I've wrestled with this issue a bit. OmniBrowser uses a
> convention where there's a separate class for each menu command. In
> the current version of OmniBrowser, with all the RB stuff installed,
> there are 167 such classes. They're not dynamically generated, each
> one was hand-coded by a contributor.

Yup. I had to "make peace" myself with Announcements before I got to
fully appreciate them. But once I realized that in return for throwing
separate classes at the problem you get complete documentation for all
the events your system might generate, this turned into a very welcome
trade-off.

> When I first came up with that design, I thought it was pretty awful,
> but I implemented it anyway, as an exercise in reductio ad absurdum,
> hoping that I would learn something that would lead me to a better
> design. To my surprise it was a massive improvement over the previous
> design, and I haven't been able to come up with anything better.

I'm not surprised. For OB this seems entirely warranted. The reasons
being two-fold: First, OB is a browser *framework* not a browser; and it
being a browser framework requires third-party extensibility in a way
that a simple browser wouldn't require. I.e., adding, modifying,
extending, and restricting commands is something that is almost
certainly needed by other users of the framework, and having commands
represented by individual classes, makes this easy and painless.

Secondly, in OB commands encapsulate much more than just a single
behavior (method invocation); they also encapsulate information about
how information is presented in menus, buttons etc. whether these should
be enabled, what icons to use etc. etc. etc. Lots of additional
information that warrants encapsulating the information separately.

> So yeah, I agree that both everything-in-one-class and
> many-classes-with-few-methods are both warning signs. OTOH, sometimes
> there are good reasons to break this kind of rule of thumb.

Yes indeed. And the reasons can be rather varied. But Occam's razor
should generally guide us to choose the solution with fewer entities :-)

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Andreas.Raab
In reply to this post by Janko Mivšek
On 12/17/2010 3:01 AM, Janko Mivšek wrote:
> Exactly. Extremes are always bad. And both extremes lower the simplicity
> and therefore maintability of the code and specially, comprehendibility
> by newcommers. That's why also wanted to show with my code stats
> comparison between Aida, Seaside and Iliad:
>
> https://spreadsheets.google.com/ccc?key=0Atnb1W9vuq9ndG4wbUpxNXpKQnFZRlFyQXpHclhZa2c&hl=sl#gid=1

This is *fascinating* data. You wouldn't by any chance have a simple
doIt that I can just run to create that analysis for our code base,
would you? I'd love to just paste that data into your spreadsheet to see
how it stacks up in comparison.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Janko Mivšek
On 18. 12. 2010 23:03, Andreas Raab wrote:
> On 12/17/2010 3:01 AM, Janko Mivšek wrote:
>> Exactly. Extremes are always bad. And both extremes lower the simplicity
>> and therefore maintability of the code and specially, comprehendibility
>> by newcommers. That's why also wanted to show with my code stats
>> comparison between Aida, Seaside and Iliad:
>>
>> https://spreadsheets.google.com/ccc?key=0Atnb1W9vuq9ndG4wbUpxNXpKQnFZRlFyQXpHclhZa2c&hl=sl#gid=1

> This is *fascinating* data. You wouldn't by any chance have a simple
> doIt that I can just run to create that analysis for our code base,
> would you? I'd love to just paste that data into your spreadsheet to see
> how it stacks up in comparison.

Thanks! And I urge more such measurements, benchmarks, statistics.

Coming from electrical science field I know very well the value of
measurements to asses the "situation" objectively and base right actions
on right analytics.

Code for this code stats comparison is freely available, just load
package WebCodeStats:

        http://www.squeaksource.com/WebCodeStats.html

It is also pretty simple to adapt to your needs, just select which
packages to measure. See for instance #setAidaCodeStats in setup.

Best regards
Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Andreas.Raab
On 12/18/2010 2:20 PM, Janko Mivšek wrote:
> Code for this code stats comparison is freely available, just load
> package WebCodeStats:
>
> http://www.squeaksource.com/WebCodeStats.html
>
> It is also pretty simple to adapt to your needs, just select which
> packages to measure. See for instance #setAidaCodeStats in setup.

Very cool. I just ran this on our code base:

Code stats           Tweak       Croquet
Nr of packages:         14            17
Nr of categories        53            26
Nr of classes:         297           241
Nr of methods:        6168          6476
lines of code:       36919         49063
Avg methods/class:    20.7          26.8
Avg lines/method:      5.9           7.5
       
Nr of test methods:      6           150
% of commented methods: 50            53
% of commented classes: 59            92

(I'll ask if I can share the numbers on the Qwaq packages as well). One
relevant note is that I don't have the Tweak test packages loaded which
explains the absence of tests. Other than that it looks as if there's
virtually no difference in terms of average length of methods (Tweak is
a little lower probably because of auto-generated accessors) but it's
amazing that the average length of Croquet (and Qwaq) methods is
virtually identical to the average length of Aida and Seaside methods :-)

One thing that was interesting to me was that when I ran the method
distribution code I found that we have a significant number of classes
with more than 50 methods (in the 10% range). In your comparison, there
is nothing listed beyond 50 methods/class. Are there no classes with
more methods in any of the frameworks, or did you prune them? What
surprised me here was that the number is significantly higher than I
expected; but it seems that there are usually one or two very large
interfaces (CPlayer in Tweak for example carrying 400 methods) and I
think it's not too uncommon to have a "handful" of classes that come in
in the 50-100 methods range.

In any case, this is extremely interesting data.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Code distribution (was Re: Gofer versus Installer)

Janko Mivšek
On 19. 12. 2010 02:56, Andreas Raab wrote:

>>     http://www.squeaksource.com/WebCodeStats.html

> Very cool. I just ran this on our code base:
>
> Code stats           Tweak       Croquet
> Nr of packages:         14            17
> Nr of categories        53            26
> Nr of classes:         297           241
> Nr of methods:        6168          6476
> lines of code:       36919         49063
> Avg methods/class:    20.7          26.8
> Avg lines/method:      5.9           7.5
>    
> Nr of test methods:      6           150
> % of commented methods: 50            53
> % of commented classes: 59            92
>
> (I'll ask if I can share the numbers on the Qwaq packages as well). One
> relevant note is that I don't have the Tweak test packages loaded which
> explains the absence of tests. Other than that it looks as if there's
> virtually no difference in terms of average length of methods (Tweak is
> a little lower probably because of auto-generated accessors) but it's
> amazing that the average length of Croquet (and Qwaq) methods is
> virtually identical to the average length of Aida and Seaside methods :-)
>
> One thing that was interesting to me was that when I ran the method
> distribution code I found that we have a significant number of classes
> with more than 50 methods (in the 10% range). In your comparison, there
> is nothing listed beyond 50 methods/class. Are there no classes with
> more methods in any of the frameworks, or did you prune them? What
> surprised me here was that the number is significantly higher than I
> expected; but it seems that there are usually one or two very large
> interfaces (CPlayer in Tweak for example carrying 400 methods) and I
> think it's not too uncommon to have a "handful" of classes that come in
> in the 50-100 methods range.

They are few classes with more methods, but not much. Let me run again:

Number of classes with more than 50 methods, max. number and second max
nr of methods in class:

         number  max.methods  next max
Aida       20       285         183
Seaside    13       228         171
Iliad       5       136          79

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si

12