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

Re: WebStyle <---> WebApplication

by Janko Mivsek :: Rate this Message:

Reply to Author | View in Thread

Edward Stow wrote:

> #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.

In Aida we use two such tricks and both you discover immediately :) One
is #dnu to connect Apps with WebStyle, other is so called "climbing on
the stack" (my term) which finds a reference to the App or session on
which you are currently building the page, in case you don't have other
means to find it. #app method is such one. More below.

About #dnu, I agree with you, it is dangerous for everyday use but
acceptable if used carefully in frameworks like Aida. Specially if it is
hidden enough from average user. Here we can argue that in Aida is too
obvious. Maybe. But we can improve (that is hide it) by using a #style
method where possible. Maybe can even go without #dnu now at all? Let we
inspect that possibility a bit.

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

#app should delegate to Object>>firstAppFromStack if it can't find app
otherwise. I'll investigate that later.

> 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.

As Nicolas said this is hardly called antipattern, just that it is maybe
too obvious/not enough hidden from the user. But really, let we come to
the better solution if possible. Nicolas already proposed to move
#pageFrameWith:title: to WebApplciation to be easily found, you proposed
  strict use of #style, any more idea?

Best regards
Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
Aida@...
http://lists.aidaweb.si/mailman/listinfo/aida

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