← Back to team overview

dhis2-devs team mailing list archive

Should we remove the Source object?

 

Hi,

I have been thinking about removing the Source object from the API.
The abstract Source class was introduced in the model in order to
allow for multiple implementations of Sources in the system. Currently
we only have the OrganisationUnit object extending Source. We now see
eg. with Abyot's CHIS module that even if we need a new kind of
Source; the Patient, we still need the OrganisationUnit reference in
DataValue.

The downsides of keeping Source are that it

- Increases complexity.
- Makes JDBC/Hibernate operations slower, since the Source table must
be updated first, then the orgunit table.
- Entails problems when people manually modifies the database (which
they really should not) as they always forget to update the source
table when adding/removing from the organisationunit table.

The only database update this would require is to set the
"organisationunitid" field in the "organisationunit" table to
auto-increment. I believe Hibernate will take care of this.

Based on this I opt for removing the Source object and moving the
OrganisationUnit object into the core.

Are there other aspects regarding this that should be mentioned? Any objections?


regards


Lars



Follow ups