Posts Tagged ‘software development’

OpenMRS Module Development Learnings – 102

My team mates and I are completing a number of OpenMRS workshops focused on improving our module development capability. This blog post captures the unwritten lessons that we have picked up as a way of giving back our lessons to help others in the community (and will be moved to the OpenMRS Wiki once the lessons have been internalized and consolidated, as that is its natural home).
The approach is based on the following OpenMRS community articles:
  1. Creating Modules – https://wiki.openmrs.org/display/docs/Creating+Modules
  2. Creating your First Module – https://wiki.openmrs.org/display/docs/Creating+Your+First+Module
As you develop the module it is important to keep testing and verifying whatever you do especially when the module involves user interface components, extending the OpenMRS UI. The process we ended up using was as follows:
  1. Setup a module using the module creation command line utility
  2. Downloaded Spring Loaded from its maven repository http://mvnrepository.com/artifact/org.springframework/springloaded
  3. Downloaded and setup OpenMRS standalone from http://openmrs.org/download/ picking a version greater than 1.11.x which supports debugging options
  4. Once the standalone version is installed, open the openmrs-standalone-runtime.properties and add the following variables to the vm_arguments: (should all be one line – separated here for clarity)
    • -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
    • -Dmodule.development.directory={absolute path to root folder of the module}
    • -javaagent:{absolute path to spring loaded jar}
    • -noverify -Dspringloaded=inclusions=org.openmrs.module.modulepackage..* (note the two trailing dots before the *)
  5. Setup newly the module into an IDE (tested with IntelliJ & Eclipse)
  6. Installed a FileSync utility, RemoteSynchronizer for IntelliJ & FileSync (http://andrei.gmxhome.de/filesync/) for Eclipse
  7. Setup sync for the omod webapp folder into the standalone webapp folder located at WEB-INF/view/module/{modulename}
Our development workflow is smoothened out since any changes to Java classes & JSPs are automatically applied & reflected in the standalone app.
Additional Tips and Tricks
  1. Tomcat – Change the following init params in web.xml:
    • modificationTestInterval from 4 to 0, so that JSPs are automatically recompiled
    • development is true (this is the default)
  2. Intellij – the Java classes are not automatically recompiled on saving changes so there is need to run mvn package -DskipTests
  3. Follow the OpenMRS conventions as much as possible by cloning openmrs-core to see how the design of the interfaces, service layers is done. This will help get access to lots of the magic that happens behind the scenes.
  4. Java 8 will give you trouble, stick to 1. 7 as we did not try 1.6 anywhere.
Advertisements

Software Development Process – The Journey

I am starting a new set of topics on my experiences in the practical application of the software development lifecyle (SDLC). The tools are as important as the people, however a versatile process will always allow you to change one without the other.

My initial exposure to the SDLC was through the Rational Unified Process (RUP – http://bit.ly/mJq8Fu) in 2001 which along with the Unified Modelling Language (UML – http://www.uml.org/) during my days of Java development. Over the next 5 years there were a number of other influences:

  1. Eclipse (http://www.eclipse.org) vs JDeveloper
  2. Hibernate (http://www.hibernate.org/) Object Relational Mapping project, to ease the SQL needed to save and update POJOS (plain old java objects)
  3. Spring Framework (http://www.springsource.org) the first step towards a useable Java Framework from Rod Johnson, with Dependency Injection, XML bean configuration, Application Contexts all dealing with POJOS. I basically memorized his whole book J2EE Design and Development
  4. Martin Fowler, Refactoring – Changing the Design of Existing Code without affecting functionality
  5. Scott Ambler – Object-Relational Mismatch, Coding Standards, and Database Refactoring
  6. Kent Beck – Junit
  7. Design Patterns from the Gang of Four – while these were not immediately applicable, they were extensively referred to in refactoring and the spring framework
  8. Alistair Cockburn – Use cases – did not make so much sense till about 2 years ago
  9. Javaworld and the Serverside.com (http://www.theserverside.com) – excellently written articles on solving common problems and experiences before Google and StackOverflow (http://stackoverflow.com)
  10. Not forgetting the good old version control, have been using CVSNT (http://www.march-hare.com/cvspro/), yes CVS on Windows, however the product has been retired, so its almost time to move, though to what – Subversion, Mercurial, Bazaar???

Also mid-way was a change of programming languages from Java to PHP mainly due to ease of deployment for web applications.

Therefore the journey will touch on the different influences to a practical process that is still evolving.

%d bloggers like this: