The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

moorlie (4) [Avatar] Offline
#1
Chapter 2, working with the source code; the Dockerfile and run.sh both contain hard-coded Maven version names for the JAR artifact. Previous experience has shown that this is not a good idea, people will copy-n-paste your POM and use it as the basis for a project of their own! They will probably change the hard coded values on first iteration and then forget smilie. Oh synical me.

Likewise in the Dockerfile you have used latest as the JDK version to base images off. Not sure that is a great idea, what if a new JDK version drops deprecated classes that your application used?

I took liberty of forking your GitHub repo and configured POM to generate Dockerfile and run.sh from tokenised templates. Small change, huge benefit, just one more plugin. Find the repo here: https://github.com/mmeany/spmia-chapter2 and there are notes about the changes here: https://github.com/mmeany/spmia-chapter2/blob/master/Notes.md.

Liking the book so far, please keep pushing forward with the chapters proposed. Got to go now as Chapter 3 landed ....

Thanks, M.
John Carnell (26) [Avatar] Offline
#2
Hi Moorlie,

Thanks for feedback. One of the challenges with writing is that there is so much material to cover that sometimes you do not follow your own best practices because you run the risk of distracting from the point you are making. I bring this up in a later chapter, because I really should abstract certain utilities into their own Jar file, but I also do not want to get into managing a mult-project maven repository for the book. In the services I write I always renamed the version of the jar file I am using at the time it is built to a generic jar file name so that the version numbers are not hard-coded into the scripts. I did not do this here.


I'll add your item to my change logs and then go through and change scripts and the docker files appropriately.
Glad you like the book and look forward to other feedback from you. I am planning on going through all of the reader feedback at the beginning of the week and Ill corporate your changes there.

As for the Docker and the Java 8 version. Great catch. I have not been burned by that yet, but I can easily see it happening and it would be a huge PIA to track down. In the movie "Big Trouble in Little China" one of the characters made the comment that the the Chinese mythology has a lot of hells. I believe there is a specific hell for Jar file incompatabilities. smilie

Thanks,
John