wiki:DeveloperGuidelines

Developer Guidelines

The wrapper class Person

All access to a persons FOAF data must be done through this class.

Values are set through the set-methods and read through the get-methods. How the set-method itself is implemented depends on the property and the desired behaviour. For example, a person can only have one firstname, so setting this value will look like:

    public void setFirstName(String firstName) {
        RDFTool.setSingleValue(person, FOAF.firstName, firstName);
    }

The implementation of the static method RDFTool.setSingleValue will ensure, that there is only one value for this property. If the passed String object is null, the statement will be removed completely.

On the other hand, some properties allow multiple values, like mbox (one person can have multiple eMail addresses). This has to be implemented differently.

Retrieving values should also be done through usage of the RDFTool methods, because this way the handling of non-existing statements only has to be done once.

Last modified 10 years ago Last modified on 07/05/07 16:20:59