The Clean Coder – Chapter 2 and 3

I continue to enjoy reading this book and am gaining a lot of useful knowledge to further my career and mold myself into a professional developer. The topic of Chapter 2 is something I have difficulty with – Saying No. Management always wants to squeeze as much work as possible out of their developers in the shortest possible time frame, and often they may have unrealistic expectations. It is detrimental to oneself as well as the company if one can not assert their position that a particular task can not be completed by the timeline management has laid out. Saying no can be difficult, but doing so early can prove to be beneficial by managing expectations of what is possible.

The topic of Chapter 3 – Saying Yes is obviously the opposite of saying no. However, a lot of the lessons from Chapter 2 still apply. One must present themselves as a professional and assert their positions, but also be realistic with what they are capable of. If a developer can complete an assigned task, then they should have the confidence to say so. They should be willing to commit to the task at hand and never shy away from their responsibility.

I look forward to continuing my reading and applying what I’ve read to help achieve my career goals.

From the blog cs-wsu – Spencer Leal by spencerleal and used with permission of the author. All other rights reserved by the author.

OpenMRS Setup

OpenMRS was not too difficult to setup, but there were a few bumps that I encountered. Cloning the code from GitHub was easy enough, but getting it into IntelliJ was a challenge. IntelliJ was not recognizing any packages or other imports, but a friend was able to help me find a way to add the packages to the scope of the program. After that, all code compiled, and all tests passed that were able to be run. However, I ended up moving over to the Eclipse environment as it works better for the purposes of the project. Importing into eclipse was easier, but did not have all the settings needed, so I had to install a few eclipse add ons such as Maven Integration, a better version control interface, and server options in case debugging in eclipse is needed. Next I set up the legacy ui by adding a module to the openmrs project webapp, and after it built and ran, I was able to view the ui in a local instance in a web browser. The sample data that can be viewed is rather odd however. I could find only 2 people in the sample data set and they were at positions 100 and 101. No other index has a person created. Not sure if this was purposeful or an accident, but I can atleast see what the database looks like and how it works.

From the blog shatos by shatos and used with permission of the author. All other rights reserved by the author.

OpenMRS Setup

OpenMRS was not too difficult to setup, but there were a few bumps that I encountered. Cloning the code from GitHub was easy enough, but getting it into IntelliJ was a challenge. IntelliJ was not recognizing any packages or other imports, but a friend was able to help me find a way to add the packages to the scope of the program. After that, all code compiled, and all tests passed that were able to be run. However, I ended up moving over to the Eclipse environment as it works better for the purposes of the project. Importing into eclipse was easier, but did not have all the settings needed, so I had to install a few eclipse add ons such as Maven Integration, a better version control interface, and server options in case debugging in eclipse is needed. Next I set up the legacy ui by adding a module to the openmrs project webapp, and after it built and ran, I was able to view the ui in a local instance in a web browser. The sample data that can be viewed is rather odd however. I could find only 2 people in the sample data set and they were at positions 100 and 101. No other index has a person created. Not sure if this was purposeful or an accident, but I can atleast see what the database looks like and how it works.

From the blog shatos by shatos and used with permission of the author. All other rights reserved by the author.

Setting up OpenMRS

Initially getting OpenMRS running was not that difficult, but connecting it to MySQL and installing the Legacy UI was a little more challenging. To Install OpenMRS, I simply cloned the repository to my machine. Initially I had tried importing the project into IntelliJ, but was having difficulty properly configuring JUnit to work with IntelliJ, so I switched to Eclipse. After importing the project, I used the command line to navigate to the directory the repository was in and ran mvn clean install. I then navigated to the webapp subdirectory and ran mvn clean install and then mvn jetty:run to get OpenMRS running whereupon I tried connecting it to my MySQL instance.

I had initially thought that I already had MySQL installed correctly, but I had to re-download an older version and the correct command line utilities to get it to run. I started MySQL from the command line using sudo /usr/local/mysql/support-files/mysql.server start

After starting MySQL the Database correctly connected to OpenMRS, but I still needed to get the Legacy UI. I cloned the Legacy UI repository, navigated to that directory, and ran mvn clean install. I then copied the legacy-ui-snapshot-1.0.omod to my ~/.OpenMRS/modules directory and everything was working!

From the blog cs-wsu – Spencer Leal by spencerleal and used with permission of the author. All other rights reserved by the author.

Setting up my OpenMRS Environment

To begin working on the OpenMRS project, me and my assigned team had to set up our work environment on our computers, which proved to be no simple task. Here is the list of steps I took in order to get it working on my computer.

  1. Checked the list of prerequisites we needed locally for OpenMRS
    • Java 1.7 or higher
    • Maven
    • MySQL 5.6
    • Git
    • Java IDE (I used IntelliJ IDEA)
  2. Clone the “openmrs-core” Github repository locally
  3. Run “mvn clean install” in the openmrs-core directory on the command line
    • Everything built fine
  4. Run “mvn jetty:run” in the openmrs-core/webapp directory on the command line
    • Wait for the message saying it is running
  5. Go to http://localhost:8080/openmrs and follow the instructions
    • I setup the database with demo data
  6. Clone the “openmrs-module-legacyui” Github repository locally
  7. Run “mvn clean install” in the openmrs-module-legacyui directory on the command line
  8. Copy the file “openmrs-module-legacyui/omod/target/legacyui-{version}-SNAPSHOT.omod” ON WINDOWS put into APPDATA/OpenMRS/modules
  9. Redo step 4 and refresh the page until the legacyUI loads

 

From the blog cs-wsu – mmoussa7wsu by mmoussa7 and used with permission of the author. All other rights reserved by the author.

Chapter 1- Clean Coder

This was a interesting chapter to read and was mainly all about professionalism.  It made me really think about what he was saying.  According to the author it is important to go above and beyond the normal 40 hours of work and instead take about 20 yours a week to help yourself develop professional.  This could be learning a new type of programming language, maybe working on a home computer issue but one way or another learn something new that will make yourself more marketable.  The other big part that the chapter talked about was testing and making sure that the you do lots of good quality testing to make your code and software more flexible and reliable.  This means to not only do some good testing at the end but instead you need to make sure that you are doing lots of testing throughout the development process.  This part struck me in particularly because I am going into the software quality assurance position.  This means that I am going to be one of the main people in charge of looking out for bugs and errors before the software gets released to the general public.  It is important so that you have a quality product so that the company has a good reputation for delivering high quality and highly efficient products.  Overall the chapter has given me some interesting things to think about before going into my professional career.

From the blog CS@Worcester – dperry2blog by dperry777 and used with permission of the author. All other rights reserved by the author.

Clean Coder Chapter 2-3

Robert C. Martin’s textbook Clean Coder: A Code of Conduct for Professional Programmers gives useful insight to being a professional programmer. After reading chapter 2 and 3 of Clean Coder, you can begin to understand the big responsibility a programmer or a team has when they say they “can” or “cannot” do something. When you are completing your tasks on a deadline, other people are relying on your work to be correct and functional. Accepting the task and saying you “can” do it, is not something that should be taken lightly. Sometimes there has to be compromise in order to release something that is acceptable. If there is something that simply “cannot” be done, then speak up and say what you actually achieve. A professional must fully stand behind his acceptance of a task, and be able to complete it. In order to be a professional in the workplace, you must have your own opinion on when and how something can be completed. These two chapters are all about the responsibility that every professional programmer must have.

From the blog cs-wsu – mmoussa7wsu by mmoussa7 and used with permission of the author. All other rights reserved by the author.

Setting Up OpenMRS Core

This task seemed fairly simple at a glance, detailed instructions, clear screenshots, and a group of classmates doing it together; what could be so difficult? To start off I had cloned the openmrs-core repository from github into my eclipse workspace. After doing so I had imported it as a git project from a local repository. After doing so I needed to convert the project into a maven project. After doing so I was able to run the project as maven clean then maven install with build success! Doing this was just the beginning. Next was to get it to work on command line and be able to run the UI for the EMR that we will soon be creating modules for. After getting into the top level of my openmrs-core directory I ran mvn clean install with another build success. Next I needed to download MySQL in order to have access to storing patient information and to also import the demo data that was given to test the EMR. After installing MySQL and then moving one level down into the webapp folder I ran mvn jetty:run. This connected me to the jetty server where I could see the UI. After going to the EMR setup I had found out that the UI was not  installed with the latest version of OpenMRS. I had to clone another git hub repository with the UI and run mvn clean install from command line to create an .omod file. This was then moved to my appdata directory inside the modules directory of OpenMRS. Finally! The last step was to go back into webapp and connect to the jetty server. I was now able to sign into the EMR and get OpenMRS core working. All that is left is to find out what tickets need to be worked on in the Radiology module.This was very time consuming as the project instructions were out of date or missing some information that would have helped along the way. The OpenMRS project is a great tool to help people around the globe and I hope to contribute meaningful work to this project!

From the blog CS@worcester – Greg Tzikas by Greg Tzikas and used with permission of the author. All other rights reserved by the author.

Beginning OpenMRS

One of the first projects that I’ve been working on this semester is the OpenMRS Project.  “OpenMRS is a collaborative open source project to develop software to support the delivery of health care in developing countries.”  I found this to be an interesting project to work on since it’s an open source project with many talented developers as well as supporting a good cause.  However, the setup to begin developing was definitely challenging.

Since OpenMRS is open source, all of their code is published on GitHub, so being able to jump in to developing should be easy. Wrong (for me at least).  First I was introduced to a new IDE, which is no big deal, that’s easy enough.  The IDE I was starting to learn was called IntelliJ IDEA, or as I like to call it, IntelliJelli.  What’s nice about IntelliJelli is that you can directly import a project from GitHub.  However, I did not do this at first.  I thought it would be easier to pull the code from GitHub and just import it myself.  Upon doing this, as planned it imported all the code, but it was missing everything; and what I mean by everything is that it wasn’t created as a maven project, it was missing some maven imports, it even had errors that I don’t know how to explain.  After being very confused and disgruntled with all the unknown errors I had, I decided I would try importing directly from GitHub.  Why I didn’t think of that in the first place is beyond me.  It worked flawlessly.  It created it as a maven project by default, it had all the imports it needed, everything was perfect except for a couple of lines that had a few errors (later I would find out that these errors are not important).

In order to finish getting a working build of this code, I had to open the console and use a few commands to get things working.  First I needed to work my way towards the OpenMRS directory and do a clean maven install.  This built the project as a maven project (again I believe? If not officially for the first time so it’s recognized).  Once the maven clean install and updates were finished, I was ready to start the server that’s contained within.

OpenMRS works within a browser so I had to work my way to the webapp folder and start the jetti program.  Now starting the jetti server worked, however I had nothing to actually work with, I needed some form of UI and database to work with while developing.  Thankfully, OpenMRS supplies an option upon the initial setup to create a fake database of people with certain information and characteristics.  To store this database, I also needed MySQL.

So the first step to this was downloading and installing MySQL, which also needed Python, visual basics, SQL connector, etc.  So before I could even get the database setup, I needed other programs and languages as well.  After installing those and finishing the installation of MySQL, I was ready to begin the installation of the Legacy UI supported by OpenMRS.  Thankfully there was a very helpful tutorial provided by OpenMRS on their wiki page, so I followed those instructions and placed the generated UI file into my appdata folder.  With this I was finally ready to begin the initial setup of OpenMRS in my browser.

Upon starting MySQL and the OpenMRS jetti server, I opened up my browser and went to localhost port number 8080.  I went through the custom / advanced setup so that I could select creating a database of fake people to use and to communicate with MySQL.  It took awhile for it to create the data, but it finally worked and redirected me to the log in page. Success.  I logged in and went straight to the database to see what I could find for data.  I found 2 people.  I can tell that the identification numbers for the people are not in chronological order, but I feel like I should have more than 2 people in my database.  I’m hoping to resolve this issue soon.

In the coming days / weeks I’ll be working on a new project with OpenMRS that deals with radiology.  The radiology team seems excited to be helping us students succeed, which is very thoughtful of them and I’m grateful for that.  Working on the tickets they suggested we look into will be interesting and I’m hoping it will put my knowledge to the test.

Until next time… Nick

From the blog CS@Worcester – Nick Richard by Nick Richard and used with permission of the author. All other rights reserved by the author.

The Clean Coder Chapter 1

The first chapter of “The Clean Coder” written by Robert Martin is about Professionalism. For being a professional programmer, he has mentioned some key points. Responsibility and accountability are two important aspects of professionalism. As a professional programmer, we should take responsibility for our code. It is our job to know what our code does and ensure that the entire code works properly. When coding, we should always aim to cause no harm in our project. This may be achieved by writing automated tests for every line of our code and test them every day to make sure that there isn’t any bug. Furthermore, we should write codes which are reusable and easy to change as we need. It is also our responsibility to keep training ourselves by reading, practicing, learning, and keep ourselves up to date on new techniques. I’ll try to be a professional programmer by using these points in my future career.

 

 

 

From the blog cs@Worcester – siminshamsblog by sshamsfallah and used with permission of the author. All other rights reserved by the author.