« 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 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.  I'm sure that smalltalkers much wiser than me have
expressed similiar sentiments.

To make matters even worse in WebStyle you send message to the app
that are then delegated back to WebStyle via the #dnu: mechanism.

WebStyle>>pageFrameWith: aWebElement wide: aWideElement title: aTitleString
        "set a web page with standard  page look (navigation bar, header) "
        "Wide element comes below content besides navigation and it have full
page width"
        | element |
        self app clear;  title: aTitleString. self app htmlHeaderElements.
" self app add: self headerBanner. "
        element := (WebElement newId: #container)

#htmlHeaderElements is implemented in WebStyle and so this would be better:

        self app clear;  title: aTitleString. self  htmlHeaderElements.

This was the second method that I looked at in WebStyle so I don't
know how prevalent this anti-pattern is in the code.

--
Edward
_______________________________________________
Aida mailing list
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

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