Here are some peripheral tips.

Subversion (SVN)
One thing I that I almost forgot is that you can rename files in svn,
in a way that you keep the history stored with the old file name.

I only use SVN through Eclipse, so that meant going to "SVN Repository
Exploring" and renaming files there.
Now you can rename your html files to tml .  You just won't be able to
pull them back out as .html , as far as I know.

You can also fix up any case names for classes here, since you'll be
doing it directly on the SVN repository and not on a
non-case-sensitive file system (Windows).

Maven
Another big issue with switching to T5 was learning Maven.  There is a
nice free pdf book out there that goes through everything you'll need
to know and more.  Dealing with maven has been documented on this
list.  Search for the words 'Shipwreck' and 'Maven'.  ;-)
It's really not that bad once you get it started.  The archetypes that
are currently out there work fine, and the location of the repository
is pretty much fixed now.  I would NOT want to download updates to all
my dependencies manually.  I don't use Maven every day and it's not
_required_ for packaging/deploying your app.  I would not avoid
learning it, it is worth your time.
Get to know the POM file that comes with the sample archetype.  It's
about as simple as you can get.  Eventually you can be "down with OPP"
(Other People's POMs) and add in the more advanced stuff and other
options.


Eclipse and Maven
Search the list for more details and caveats.
For Eclipse to see your local repository, you'll need to set a
classpath variable  (window->preferences->build->classpath variables)
M2_REPO
C:/Documents and Settings/JueD/.m2/repository


Directory Structure
Working with maven helped me to find a pleasing, flexible way of
laying out my directory structure.  I would adopt and expand on the
structure you get from the tutorial Archetype.  From looking at other
people's code online, I really like the feel of separating the Web
User Interface layer from the rest of the app.  You don't really see
this from the tutorial Archetype.  I like putting my Tapestry related
code under
com.mycompany.myapp.wui.tapestry, which is what you'd put as the
context root in your web.xml.

Then you'd have
com.mycompany.myapp.wui.tapestry.pages
com.mycompany.myapp.wui.tapestry.components
com.mycompany.myapp.wui.tapestry.base
com.mycompany.myapp.wui.tapestry.services
com.mycompany.myapp.wui.tapestry.mixins
etc.

Where to put files:

I tend to avoid putting files in my WEB-INF.  I am not sure if this is
a best practice, but since the directory structure under java/ is
merged with the directory structure under resources/ , these seemed to
be the logical places to put files.

For instance, a page MyPage would be here:

src/main/java/com/mycompany/myapp/wui/tapestry/pages/MyPage.java
src/main/resources/com/mycompany/myapp/wui/tapestry/pages/MyPage.tml
etc.



Preparing to Dive into T5
Make a backup or tag your application in SVN.  You should probably
lump in any other code refactoring you want to do, while you're at it.
If you are going to adopt the new directory structure, plan for
further separation of your core application code and your display
framework code.

The biggest feat is to just sit down, lock the doors, put on a pot of
coffee and do it.  If you've got a backup of the application in it's
current T4/T3 form just dive in and start a new T5 Archetype.  Then
make necessary directory changes and start migrating the NON-tapestry
portion of your app.  This should also open the door to any unit tests
you want to create for your core, since Maven will create a test
module for you.  Note that T5 uses TestNG, which has advantages over
JUnit.  You may want to pick up a book on it, or at least bookmark the
documentation.

Once your "back end" is set up, start migrating superficial pages, to
get used to the new terminology.  I started with my Layout component,
which ended up becoming Border.java.  These small and simple pages
will become your reference templates for your complex pages.  There
are many new features in T5 (especially T5.0.10+) that make things a
lot easier, such as the clean and fast ${expansions}, ability to
inject pages and intercept exceptions in the page/component.
Injecting javascript and css files is also very clean and easy.
Consult the Tapestry website (official release docs and know where to
find the nightly release docs).  Print out any flow charts/lifecycle
charts you come across and post them where you can see them.

Make a concise list of all the annotations that are available and the
rules for using them (some can be found on the Wiki too, so reference
the Wiki as well)

When adding a page, look at the documentation/list/wiki about friendly
URL caveats.  Also if you're starting with a .tml file, I would make
sure you name it just like the class file will be named (I mean, the
Case of the filename), so you won't want to change it later.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to