• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Migrating existing application to Griffon

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andres & Danno,

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?

Thanks,
Jeff
 
author
Posts: 47
VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeff,

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.

Cheers,
Andres
 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Thanks,
Jeff
 
Andres Almiray
author
Posts: 47
VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeff,

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.

Cheers,
Andres
 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Andres. I'll be sure to give it a go. Appreciate your contributions to the forum!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic