I work on a swing application, and we currently use a lot of groovy for the back end. We use some groovy on the front end, especially the SwingBuilder, but much of the core UI code is written in pure Java. The application is pretty small right now (~50k sloc for UI and backend combined). Would you recommend trying to migrate the app to the Griffon framework as it grows to help manage it? Or might it be too difficult to migrate and existing app such as this?
Considering that you already have a combined codebase I'd say you're in a good position to make the switch.
Bear in mind that Griffon lets you mix & match Groovy and Java code in all possible combinations, that is. you can have a Java based controller with Groovy based Models and Views for example; or you can have every single member written in Java or Groovy; it's up to you.
Migration depends on how tightly coupled are the current components/classes of your application. If it's easy to identify which properties belong to a Model, which methods can be refactored into controller actions and what can be pushed to the service layer then you shouldn't have much trouble.
You can also drop your current codebase into src/main and make shell controllers/services that delegate to that codebase. Later you can refactor the code to move it to their respective places in each MVC member artifact.
Thanks, Andres. I'm excited about trying out Griffon.
One thing that still concerns me about migrating to Griffon is that I'm wondering if it will be possible to migrate over gradually, or do I need to basically stop everything and do a big change all at once? Your thoughts?
Well, a colleague of mine is working with a team that built their own Java Swing framework. He convinced them to give Griffon a try. Considering that this is a very conservative Java shop they began by creating an skeleton app and place all the existing sources into src/main. They use the initial MVC group that was created with the app to bootstrap the "legacy" code. This has been going for 2 weeks I believe. The team is now ready to make the next step, which is migrate some of the legacy code into proper MVC members.
I would suggest you to follow the same path. You have one advantage over them though, that your views are already groovyfied. Switching to full Griffon views shouldn't be much of a trouble. I would highly recommend you to pay attention to Models and bindings. They will help you eliminate a lot of bolierplate code for keeping state up to date.