tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship" <hls...@attbi.com>
Subject Use of interfaces ...
Date Sat, 01 Feb 2003 16:08:20 GMT
Just a random thought ...

Tapestry uses a few key interfaces:  IComponent, IPage, IEngine,
IRequestCycle being the main ones.

In theory, you could brew up your own IComponent implementation, not
AbstractComponent.

Increasingly, though, the framework is making expections that your component
classes inherit from AbstractComponent.  For example, the new class
enhancement code expects that fireObservedChange() (provided by
AbstractComponent) is provided by a superclass.

Every once and a while, I think about scrapping IComponent and IPage,
renaming AbstractComponent to Component (or TapestryComponent, or
WebComponent), and likewise of AbstractPage.

There are also theoretical performance improvements in shifting from
interfaces to abstract base classes.  Method invocation against a class is
more efficient and easier for Hotspot to optimize than invocations against
an interface (in fact, there are different bytecodes for invoking a virtual
method vs. invoking an interface method).

At some point, I'll have an environment where I can do performance testing
... perhaps I'll match them up against each other!


BTW ... is my sig (below) too obnoxious?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry



Mime
View raw message