Brian K. Wallace <brian <at> transmorphix.com> writes:
> I think, aside from the brace positioning, we're going around in circles
> on things about which we just need to agree to disagree.
I agree the need to adopt a uniform coding convention for
a project. However, this doesn't contradict with the need
to discuss the pros and cons of the various coding
conventions.
> and if you use "Page" for the interface, and you code only one
> implementation - what is it? BasePage? No, we went all the way and
> aren't using "Abstract" to denote an abstract class and BasePage already
> exists as an Abstract class. How about "DefaultPage"? Ok. Now look at
> your files: Page, BasePage, and DefaultPage. Without opening up your IDE
> what is what?
This is indeed a problem. We have to ask how DefaultPage/AbstractPage
differs from BasePage. If we're talking about the Tapestry, I think
AbstractPage should be called DefaultPage or BasePage, while
BasePage should be called HTMLPage.
Or better still, currently in my opinion Tapestry uses too much
inheritance. I believe by using delegation most of the naming difficulties
can be solved. For example, the only difference between AbstractPage
and BasePage is just the use of an HTMLWriter. If AbstractPage
used delegation:
class AbstractPage {
public AbstractPage() {
useHTMLWriter();
}
public AbstractPage(MarkupWriter writer) { ... }
public void useHTMLWriter() {
writer = new HTMLWriter();
}
public void useWAPWriter() {
writer = new WAPWriter();
}
}
Then we can eliminate BasePage entirely. Our regular pages can
be like:
class Home extends AbstractPage {
}
class WAPHome extends AbstractPage {
public WAPHome() {
useWAPWriter();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]