Grails - Reloading a service without stopping your app

When a grails application is started most Grails artificats are reloaded as they are changed – controllers, filters, tag libraries, but the opposite is true if you strongly type your services like below.

FakeService fakeService

However if you use untyped injected like

def fakeService

then the service will be reloaded as changes are made. This may have been obvious to most people, but I was originally going through the hassle of either restarting my app after each change (huge time waster) or creating a fakeServiceHelper where I made all my changes and introducing a needless extra layer to my application to avoid restarting my app after each change.

Matt Busche's Picture

About Matt Busche

Software Engineer and Wheel of Fortune Expert If this article helped you, please consider buying me a book.

Des Moines, IA https://www.mrbusche.com