PharmGKB consists of data and a software platform called PharmGen. The PharmGen code is based on a standard three-tiered architecture (Figure 1) whose main strengths include its flexibility and portability. Each tier is completely independent of one another and can be developed separately and modified as required provided the basic interfaces are not changed.

The PharmGen code, written in Java, roughly breaks down into four categories (Figure 2):

The PharmGen object model defines all the domain objects of interest to the PharmGKB (e.g., genes, drugs, disease, reference sequences, PCR assays, etc.). These objects are obtained through an object loader, which hides all persistence details from its clients. The object loader can persist domain objects to a database, a web service (via SOAP) or a Protege knowledge base.
In addition to the object model, various services have been developed to work with the domain objects. These services perform some action on the domain objects, such as validating them to make sure that the data they contain makes sense, or generating new knowledge based on data that is currently available in the domain objects.