I've been meaning to write an update for this blog for a number of weeks now. I've been happy with my progress with developing the business' website with Groovy on Grails. I'll try to talk more about that below. Aside from a few fixes and additional enhancements, the alpha version of our web-based application is completed. Progress with the business itself has been slower than I'd like. That is both a good and bad thing. It's good, because my desired pace would likely be faster than would be good to ensure the business is a success. Part of the lack of pace was our business partner being busy with his day-job and recently accepting a new job in a city across the state. So, now my professor and I are communicating with our contacts for a new business partner to get things going again. Other than that, the site itself has shaped up well and developing it with Grails has not been difficult.
One of the reasons I went with Groovy on Grails was the need to integrate existing Java code into the site. No one wants to rewrite existing code in another programming language. This is especially the case, as with ours, that the existing code depends on APIs that is available only in Java. Grails allowed me to easily integrate my existing Java code. In my Grails project there is a "src/java" package/folder. I created packages within this area for my existing code. I copied the base of my existing code to these packages and then wrote a couple new classes to fit between my existing code and the Grails site. This was due to my existing code expecting it to be called with a certain set of data. My "middle men" classes massaged the data that resided with the Grails site to a form that my existing Java code was expecting. The reverse was also true, my existing code had output in one format, and I added some code to take that output and provide it in a form the Grails code could use. Additionally, the Java code that I wrote to go in the middle could directly access the Grails domains to serve as data structures. The getters and setters for the variables in the domains were also available by the Java code.
There are still some hiccups that I'll need to test and try more. For example, in one of my domains I wanted to rename one of the field names. Grails provides the ability to automatically update production databases based upon changes to the domains. (The domains are mapped to database tables with Grails.) Changing the name of a field within the domain resulted in a new field in the database and the old field name remaining in the database. For now it is not big deal since the database contains just test data. However, it is something to keep in mind in the future. While I was intending to use the same data with just a different field name, the end result with Grails was that I couldn't access the data saved with the old field name. This could probably be easily resolved by updating the database table to change the field name before updating the Grails code on the web server. Still, it is something you would need to be proactive about or be aware of should you not rename the database field first.
One thing I have not been good with doing is testing. Grails has unit testing built in with a version of JUnit. When you generate controllers and views with Grails it will update the test code to make generating test cases quicker. However, I have not be utilizing it yet. Testing so far for me has been to actually interact with the web pages and ensure that they are operating correctly. The result is I'll miss some errors or pages that need to be tested. Unit testing is a big deal that, unfortunately, is not covered in either the Bachelor's or Master's program at my school. I have only very minor experience creating and performing unit testing with JUnit. So far with this site I've been focused on getting it coded, learning how to use Groovy on Grails and a working alpha version up and running. There hasn't been time to also learn how to make best use of unit testing with Grails. As I knock off the last few things with the alpha version, there is going to be a period of time where we invite companies to try out the site and give us feedback. I think this time will be good to learn how to make use of unit testing with the site. I can practice generating test cases for the existing code, learn about any special cases to get test cases working, and start providing a foundation for unit testing for the site as it moves forward.
Overall, there's been good progress with the business. The site is basically up and running and ready for companies to be invited to participate in using it. We're attempting to get the business side going, even if we are having to transition to a new business partner. Groovy on Grails has worked out very well for me and this project. I still have more to learn about it, but I think that will always be the case.