# Adding New Datamodel Objects To Jalview

There are some basic requirements for all Jalview datamodel objects. None of them are mandatory, but each one makes it easier to integrate a new datamodel object into Jalview.

The primary requirement of classes within jalview.datamodel is that all class implementations must be byte-code compatible with a java 1.1 runtime environment. This is an imposition from the Jalview applet, which is dependent on the core jalview.datamodel package. It is possible to include dependencies to objects which are not available to the JRE1.1 environment, providing you ensure that a test is made at run-time to decide if these dependencies are followed within any particular method. But generally, it is best to stick to 1.1 coding style - that is no generics, no fancy Iterators or use of specific JRE object methods and interfaces introduced after 1.1 (such as the get method for java.util.Vector).

### Steps for integrating a new class into the datamodel

1. Implement in Java 1.1 compatible source.
2. Implement copy constructors for the benefit of any datamodel classes that reference it:
   - If it is referenced by AlignmentI or SequenceI
     The jalview cut and paste mechanism relies on copy constructors and a 'pseudo-copy constructor' method to make new versions of datamodel objects which correctly inherit references to a subset of attributes referenced by the original objects, and otherwise contain complete duplicates of data (sequence characters, annotation and sequence features) local to that object.