Getting to know the architecture of the openmrs code base

Hi all, I realize that openmrs is a giant project with around 4 million lines of code, and buried under layers and layers of java frameworks. While I was browsing through the code, I realized that there’s just way too many sub-projects and packages to try and make sense of it for a newcomer.

I think it would help to have some kind of a macroscopic architecture diagram to document how different sub-projects and packages of the openmrs code base are tied together. How are they categorized the way they are? What role does each function? How should I try to come about to understand them? Wouldn’t a developer need to understand (to some degree) how the packages are organized and co-operate to realize a functionality, so that he/she may debug or develop with efficiency?

The above concern is for something more than what I see in the picture in the developers starter guide. While I’m conceptually familiar with each of those frameworks, I was asking for a code-level documentation sort-of thing. It’s a little hard to elucidate what I’m talking about, but it is essentially a more detailed map of how the projects and packages are organized within the openmrs code-base. Yapp… that’s it! Can someone help??

1 Like

These may not too much up-to date but will not leave you the same:

http://en.flossmanuals.net/openmrs-developers-guide/architecture/

https://wiki.openmrs.org/display/docs/Module+Architecture

Best Wishes

1 Like

OpenMRS core is just 96.526 lines of code

https://ci.openmrs.org/sonar/dashboard/index/1865

1 Like

In github, there is some documentation about the project tree, thought it doesn’t break it down to the packages, we try our best to name packages in an intuitive way to make it easier for people to understand what goes where and what shouldn’t.

You can also take a look at our Technical Overview to get a better idea about how the different components are glued together.

But i agree it can be better, because some of the things documented might getting outdated

IMHO nothing beats a good UML class diagram to grasp a system architecture. But I guess it’s not agile enough :slight_smile: Sometimes I’m tempted of creating them with Enterprise Architect (my favourite tool) but it requires a license. I think we need at least:

  • a domain model diagram (persistent entities)
  • a diagram showing controllers, services and DAOs and its relationships

For complex processes sequence or activity diagrams would be useful too.

See data model though i think we need new versions to be added

I added a linke to http://burkeware.com/openmrs-data-model/, which provides a browsable view of several of the recent versions of the datamodel.

Hi Lluis,

I could feel that this is entirely true. Could you give me the exact source files and line numbers for the 97 lines of code that make the openMRS core?

As I was watching through the video, I came across a slide that was actually very interesting (~21:28 min.). It described the various layers that make the openMRS system as of 2012. Is it possible to map the source code packages to these particular layers by any chance? Granted that there may be numerous utility classes/packages, and the mapping may not be that clear-cut, is it possible to make such an association? Thanks…

https://ci.openmrs.org/sonar/drilldown/measures/1865?metric=files