Goodbye XCode!
At last, I am free of XCode ......
Finally, rid of XCode as a cumbersome, slow,
unproductive WebObjects (and java for that matter) development tool. Yippee!!
Yahoo!! :-) Once you get a taste of WOLips/Eclipse and then go back to working
on a sizeable XCode project, you realize how much time is being wasted by the
stop/restart and the compile and build times ......... not to mention the time
wasted looking up javadocs when the flaky code-sense decides to half-work or not
work at all. This week, I am on a critical path to add new features and XCode's
productivity was just killing me, so I just had to bite the bullet and convert
this project to Eclipse.
Here is a few
strategy tips for those who are thinking about switching to Eclipse/WOLips, but
might feel it is such a big step and how can it be done with so much project
work, deadlines, etc., etc. I am in a hurry, so this is a quick post and not as
comprehensive as I would like
normally.
Get
Familiar
First get familiar with
Eclipse/WOLips. Go to the WOLips website, go thru the tutorials. Just chip away
at it for a little bit each day or every other day. Then take some stable small
frameworks that you have already and convert them to Eclipse projects, then
build, install, deploy to get familiar with necessary everyday tasks. I
recommend using the nicely arranged WOnder project templates for apps and
frameworks even if you are not using the WOnder frameworks ....... if you are
not using WOnder you should be, but hey, that's another discussion. If you have
no existing frameworks, then take some of those stable reusable classes in your
current project and create a reusable framework in WOLips/Eclipse. Start with
just a few classes in case dependencies overwhelm you! Time to get out of those
bad development habits that XCode leans towards such as everything being in the
default package. Create and deploy your new framework and change your XCode
project to reference the new framework and delete the old
classes.
If you are starting a new
project, do it in Eclipse/WOLips ....... get used to working with the component
editor and Entity Modeler. Don't depend on using old EOModeler or WOBuilder
after switching to Eclipse, IMHO, you will have better success sticking with
WOLips Entity Modeler and built-in WO component editor once you switch to
Eclipse.
This exercise alone will help
you to get familiar with all the everyday tasks you need to perform in Eclipse
... and give you a taste of how a "real" java IDE should
work.
Tests
Before
conversion set up a full suite of tests that give you confidence in your
application. I recommend Selenium IDE plug-in for FireFox. It's easy to use,
intuitive, and Chuck Hill made a plug-in that allows it to record actions
without the 0.0.4.3.4.5. stuff and session stuff in the URL's. Search the wo dev
lists for more info or ask about it on the wo-dev
lists.
Conversion Steps
Overview
When your tests are all passing
on your XCode project, it's time to
convert.
- Create a new project with the same
name in your Eclipse workspace
- Configure
your WO Frameworks references so they are the same as your current XCode
project
- Select project icon in the XCode
Groups & Files pane and use the Regular Expression file filter (upper
right-hand cornder of XCode window) with the expression
^.*[.]java$
-
Assuming you have a standard unpackaged XCode project, select all the java files
and initially drag them to the default package icon in your project sources
folder in Eclipse, replacing default Application, Session, Main,
etc.
- Next change the Regular Expression
file filter to
^.*[.]wo$|^.*[.]api$
to display all the wo and api files in XCode and sleect and drag all those to
the components folder in your Eclipse project. (We will use Eclipse's
refactoring tools to organize the project as we please later ..... don't waste
your time trying to refactor in XCode before your conversion to
Eclipse)
- Next grab your Resources stuff
such as Properties and eomodel(s) and drag those to the resources dir in your
Eclipse project.
- Next create a single
package (for now) for your app. For example com.myappname or
whatever.
- Select all the java files and
right-click -> Refactor -> Move and move them all to the new package.
(Your can also drag and drop them on the new package if you
prefer)
- Next fix all the static errors that
Eclipse has found in your java files and your WOComponent files (yes, it finds
errors where in XCode there were none and your project was running and passing
tests!). Notice the static analysis of your wo/wod
files
- Finally run your project in Eclipse
and run your test suite ... fixing any errors that show up (for example I had a
few protected access methods in WOComponents that needed to be changed to public
and these showed up during testing)
- Once
all your tests are passing, then deploy to a server and run a test instance
under a different name ........ this will force you to update any deployment
scripts. You can build form the command line easily by referencing the woproject
jar in the ant command.
Now, get doubly
productive and enjoy developing in Eclipse! ..... OK, break time is over ....
back to coding!
~ Goodbye XCode ....
Hello Eclipse/WOLips :-)
PS. Thanks to
Mike Schrag, Ulrich Köster and all the other WOLips committers for a great,
great set of WebObjects development tools. Let's appreciate the valuable
contribution they make to the community and never take their efforts for granted
and always reflect that in our posts to the developer mailing
lists.
Posted: Sat
- April 21, 2007 at 03:58 PM