Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3

Introduction

This page contains informations about the migration of OpenHospital to Spring framework.

For every module, every layer should be Springified, starting from the lower levels (database access code).

The application entry point is org.isf.menu.gui.Menu.main(), where the Spring Application Context is started up. The configuration file applicationContext.xml was added to the rsc folder. Remember to add that folder to the build path, so that its contents ends up in the classpath while running in Eclipse.

An example: the examination module

This example focuses on Spring-ification of the org.isf.examination.service.ExaminationOperations class.

  1. The @Component annotation was added to the class

  2. The constructor was deprecated, since every instance of this class now should be obtained via Spring ApplicationContext

  3. Static variable session was put inside methods. Spring beans are singleton by default, so they must not keep any state in static variables.

  4. The call to the constructor was replaced with Menu.getApplicationContext().getBean(ExaminationOperations.class) in every class it occurs (in this case, in src.org.isf.admission.gui.AdmissionBrowser, org.isf.admission.gui.AdmittedPatientBrowser, org.isf.examination.gui.PatientExaminationEdit, org.isf.opd.gui.OpdEditExtended)

  • No labels