« Return to Thread: WebStyle <---> WebApplication

Re: WebStyle <---> WebApplication

by Edward Stow :: Rate this Message:

Reply to Author | View in Thread

On Wed, Apr 2, 2008 at 9:28 AM, Nicolas Petton <petton.nicolas@...> wrote:

>
>  Le mercredi 02 avril 2008 à 07:05 +1100, Edward Stow a écrit :
>
>
> > On Wed, Apr 2, 2008 at 8:06 AM, Nicolas Petton <petton.nicolas@...> wrote:
>  > >
>  > >  Le mardi 01 avril 2008 à 20:35 +0200, Janko Mivšek a écrit :
>  > >
>  > > > Hi Edward,
>  > >  >
>  > >  > Edward Stow wrote:
>  > >  >
>  > >  > > My question, first up,  how would you create two or more WebStyles for
>  > >  > > a site? and apply these to particular pages (or rather WebApplication
>  > >  > > objects.)
>  > >  >
>  > >  > So far no. WebStyle is originally meant to separate design from site to
>  > >  > site on multi-site hosting environments. For instance I'm running such a
>  > >  > VW image with 35 sites and each such site has its own subclass of WebStyle.
>  > >  >
>  > >  > But why would you actually need WebStyle for each App?
>  > >  >
>  > >  > > My question led me to investigate WebApplication and WebStyle a bit
>  > >  > > more closely.  These two  classes seem very coupled and because of the
>  > >  > > obscuring (imho) #dnu: implementation ... that redirects many, many
>  > >  > > messages to the style class it makes it difficult to understand the
>  > >  > > framework.
>  > >  >
>  > >  > Yes, this one is funny on first sight but very powerful after you
>  > >  > understand it. In a way It extends Apps to a WebStyle, but for each site
>  > >  > differently. But on the other side is hard to debug and hard to
>  > >  > understand for a newbie. Actually calling style methods explicitly:
>  > >  >
>  > >  >               anApp style pageFrameWith:title:
>  > >  >
>  > >  > is the best way to go and I'll actually change all my code to use this
>  > >  > #style method. Thanks for comming out with that idea!
>  > >
>  > >  I personnaly like self pageFrameWith:title:, it is shorter, and use this
>  > >  very cool overriding of #doesnotunderstand: :)
>  >
>  > #doesNotUnderstand:  should come with a warning about the consequences
>  > for its use.
>  Not necesseraly. In this case it is very powerful, and anyway if the
>  webstyle doesn't understand the message, an error will be raised.
>
>  This pattern (not an anti-pattern at all!) is used in other frameworks,
>  in other langages too. If you know Ruby and Rails, you know that
>  accessors are created on the fly this way. You may not agree, but it is
>  still useful IMHO.

I have done similiar tricks -- for example on a Row Data Gateway [1]
to access attribute values from a relational dbms table. This usage is
a well known pattern / idiom for the #dnu.

[1] http://martinfowler.com/eaaCatalog/rowDataGateway.html

>
>  >   I'm sure that smalltalkers much wiser than me have
>  > expressed similiar sentiments.
>
>  Again, I do not agree. Look at Object>>doesNotUnderstand: inherence and
>  you will see how many classes override this message to perform a special
>  pattern. Some example: ObjectExplorer, MagmaCollectionReader (from Magma
>  OODB), WAModelProxy (from Seaside), and so on.
>
These examples are implementing a well known pattern(s).  EFor example
WAModelProxy is implementing a proxy that would be difficult without
the dnu.

ObjectExplorer will be doing massive amounts of introspection needed
to support the browsing of objects.

The usage in WebApplication is to delegate messages creating a sort of
mixin class with WebStyle.

I liked this from comp.lang.smalltalk some years ago:

"(Kent Beck had an interesting "koan" button at OOPSLA. It read "Will
override #doesNotUnderstand: for food!" What was most interesting was the
very different reactions it got from those doing Smalltalk for 1 year, 2-5
years, and 5+ years, which went something like "duh," knowing grin, and
pained expression, respectively!)" [2]

[2] http://groups.google.com/group/comp.lang.smalltalk/msg/85fb5f6714fa3d37?

and
David Buck points out some of the dangers [3]

[3] http://tinyurl.com/yrxy9p

and Travis Griggs some of the places that it is useful.

[4] http://tinyurl.com/yosjrs
_______________________________________________
Aida mailing list
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

 « Return to Thread: WebStyle <---> WebApplication