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

Re: WebStyle <---> WebApplication

by Nicolas Petton :: Rate this Message:

Reply to Author | View in Thread


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: :)

>
> This method was introduced recently, which is the reason of non-use so far.
>
> >
> > WebApplication>>doesNotUnderstand: aMessage
> > "forward a message to a style for processing"
> > ^self style
> > perform: aMessage selector
> > withArguments: aMessage arguments
> >
> > My troubles began in the tutorial and the #pageFrameWith:title:
> >
> >     viewMain
> >         | e |
> >         e := WebElement new.
> >         e addTextH1: 'Address book'.
> >         self pageFrameWith: e title: 'Address book'
> >
> >  I guessed that #pageFrameWith:title: must be setting up the page
> > layout (the header, menus etc) but was surprised to find that
> > #pageFrameWith:title: was not implemented in the WebApplication
> > hierarchy.   Why not directly send the message to the WebStyle object
> > (and it is less expensive cpu wise) such as:
> >
> >         self style pageFrameWith: e title: 'Address book'
> >
> > WebStyle seems to me to incorporate at least the following features:
> >  -- setup a page template for the *Aida tutorial* site (the  page
> > headers, footers, navigation bars etc)
> > -- establish assets for the site (html header information - css files,
> > images files, script files)
>
> Web site stye in Aida don't mean just CSS, but also a basic layout of
> the page, which is usually HTML. That's why you'll find many basic page
> components defined in WebStyle sublcass, not in app. Specially those
> components, which appear on every page. Reusable components, if you like.
>
> Current WebStyle should better be named as DefaultWebStyle and be
> subclasses from an abstract WebStyle. WebStyle would be just with
> support methods and maybe some default ones like #pageFrameWith: . That
> way it would be easier to subclass by your needs.
I'm working on this. It's almost done, but not committed yet (sorry
about that). I'm also working on a new class WebLibrary, to delegate a
bit. (WebStyle is really overloaded).
>
> > Subclassing WebStyle to create my own web site page template is very
> > messy (as per the Joomla example ..)
>
> It's true, for instance currently nulifying superclass css methods needs
> to copy and make them return empty string here. Very inpracticall. We
> need to finally implement that #addSuperStyles for breaking the
> additions of superclass css methods to the final css.

Will this be needed when we will have an abstract WebStyle class ?

Cheers!

Nico

>
> > Sorry for the long message -- in part I need to document these issues
> > to better understand them myself.
>
> And we need such questions to improve our docs!
>


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

signature.asc (196 bytes) Download Attachment

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