Is that really the case? That the Tapestry way is to create components instead of inheritance? For example I have code that I use in almost every page and it's much less brittle to just call a method name rather than calling getComponent() with a string parameter.
I mean I use components all the time and they're very powerful but in cases where every page has the same method it just seems more OO to put it in a base class. But I'm relatively new to Tapestry so I may be off base. :-) Mike On 6/30/05, Ron Piterman <[EMAIL PROTECTED]> wrote: > I have tried a few times using base classes and inheritance. > At the end I came to the conclusion that "the tapestry way" is using > components *instead* - if a page is a "container" with some > functionality, a component is also a container... so instead of > implementing things on the page scope, implement them on a component, > and drop the component on a page... > Cheers, > Ron > > > ציטוט Michael Engelhart: > > Thanks but I'm using Java 1.4.x and Tapestry 3.0. > > On 6/29/05, Nick Stuart <[EMAIL PROTECTED]> wrote: > > > >>You can with annotations fairly easiely, and you can even do it with > >>interfaces if you really want (Howard shows an example of this > >>somewhere). > >> > >> Say you have an object you wanted injected into some > >>pages/components, write an interface like so: > >> > >>public interface ObjectUser { > >> > >> @InjectObject("service:someService") > >> public SomeService getSomeService(); > >> > >>} > >> > >>then, if you wanted a page/comp to be able to access this just > >>implement the interface and call the method. Really is that easy. I > >>thought this was pretty slick at least. > >> > >>-Nick > >> > >> > >>On 6/29/05, Michael Engelhart <[EMAIL PROTECTED]> wrote: > >> > >>>Hi - > >>>Is there a way to create a templateless abstract base page for a Tapestry > >>>app? > >>> > >>>I currently have a base page class that extends BasePage but I want to > >>>make that class be able to take advantage of a page specification to > >>>limit the writing of code make clean up of persistent properties > >>>easier. > >>> > >>>Is there a way to do this? > >>> > >>>THanks > >>>Mike > >>> > >>>--------------------------------------------------------------------- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >