Well, without autowiring (it'll be in there soon), you have to use .page files to inject service objects into your pages if you're not willing to use annotations. With autowiring, though, all you'll have to do is create a "getter" for a property of the same type as one of the HiveMind services and it'll be auto-wired for you.
-----Original Message----- From: Paul Cantrell [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 10:48 AM To: Tapestry users Subject: Re: Page files or annotations? [was: Validation] I think Sam has it right: it depends. In my development, I never write page files -- but we don't have any separate person devoted to the page design. That seems like the only compelling case left for the page files, but it is somewhat compelling: it keeps as much as possible out of the page file, so the designed can focus on the HTML and not have to tiptoe over so much extra baggage. (One can of course use annotations to achieve that, too, but it requires declaring tons of getXyzComponent() methods that clutter up classes.) However, without the separate designed role, I find the annotations approach keeps things much cleaner. Unless you're keen on keeping the templates as pared-down as possible, then, I'd recommend that. In Tap 5, it sounds like things are moving towards annotations only. Hopefully 5 will reduce the verbosity of some of the common cases. Cheers, Paul On May 10, 2006, at 7:49 AM, Sam Gendler wrote: > On 5/10/06, Martijn Hinten <[EMAIL PROTECTED]> wrote: >> I have been wondering this for some time now: Is it the general >> consensus >> to get rid of .page files and do all binding in the html (and >> injection via >> annotations in the java classes)? >> > > I think it depends on the size of your team and complexity of your > app. With a fairly large team, including one person devoted to > layout, I prefer to keep all component declarations in .page files, so > that the layout templates are as clean as possible and least likely to > get screwed up by someone making edits without a clue about how > tapestry works. I've generally got nothing but jwcid attributes in my > templates. A simple macro in just about any editor will make it easy > to switch between .page and .html files in a single keystroke or mouse > click, so the complaint about having to switch files really isn't > valid, to my mind. > > We also attempt to keep components in the same order in the .page file > as they are used in the .html template. It is a couple of minutes of > developer time per page at the end of any release cycle on any pages > that have gotten out of whack and it keeps things easy to find. In > fact, I have a macro in vim which will switch to a .page file and go > to the same location as I am currently at, as a percentage of the file > length, with two keystrokes. Odds are usually good that I can see the > component that I am looking for as soon as the other file is visible, > and both files are so much more readable as a result. > > The only thing I hate is when informal parameters are important to the > function of the component, since, as far as I know, they must appear > in the html file. I really wish there were a way to bind informal > parameters to a component from within a .page file, overriding any > informal parameters of the same name that are in the .html template > which may be necessary for layout in the unrendered page. That way, I > could put ALL of my parameter bindings in the .page file. > > --sam > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > _________________________________________________________________ Piano music podcast: http://inthehands.com Other interesting stuff: http://innig.net --------------------------------------------------------------------- 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]