← Back to team overview

dhis2-devs team mailing list archive

Re: Should we remove the Source object?

 

2009/8/26 Lars Helge Øverland <larshelge@xxxxxxxxx>

> 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
>
> Hi,

I support this proposed change.

As you say, it is most likely that we would have to keep a reference to an
orgunit in any case, since most data relate to orgunits somehow, and then we
would need another object, like the Patient. If it speeds up the application
and simplifies things I think we should make the move in stead of waiting
for something that has not come up over the last 4 years, and now seems even
less likely to happen......

Ola
-------------

References