---
name: "GO::ObjFactory"
section: "3pm"
platform: "linux"
package: "libgo-perl"
version: "0.15-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/GO::ObjFactory"
---

# GO::ObjFactory(3pm)

## NAME

```
  GO::ObjFactory     - GO Object Factory
```

## SYNOPSIS

You should not use this method directly

## DESCRIPTION

You only need to be aware of this class if you are generating new objects. You should not directly create objects like this:

```
  $term = GO::Model::Term->new($h);
```

Instead you should create them like this:

```
  $fac = GO::ObjFactory->new();
  $term = $fac->create_term_obj($h);
```

Usually you do not need to instantiate a factory, as all objects created with a factory carry around a reference to that factory, so you can do this:

```
  # $graph object was previously created via a factory
  $term = $graph->create_term_obj($h);
```

If you are only using the go-perl module, then factories do not buy you much. However, if you are also using go-db-perl and GO::AppHandle, then factories can be useful - all objects generated from the database will be attached to an AppHandle which means that "lazy loading" can be used. See GO::AppHandle in go-db-perl for details

### create\_term\_obj

```
  Usage   - $term = $apph->create_term_obj;
  Returns - L<GO::Model::Term>
  Args    -
```

### create\_relationship\_obj

```
  Usage   - $relationship = $apph->create_relationship_obj;
  Returns - L<GO::Model::Relationship>
  Args    -
```

### create\_xref\_obj

```
  Usage   - $xref = $apph->create_xref_obj;
  Returns - L<GO::Model::Xref>
  Args    -
```

### create\_evidence\_obj

```
  Usage   - $evidence = $apph->create_evidence_obj;
  Returns - L<GO::Model::Evidence>
  Args    -
```

### create\_seq\_obj

```
  Usage   - $seq = $apph->create_seq_obj;
  Returns - L<GO::Model::Seq>
  Args    -
```

### create\_db\_obj

```
  Usage   - $db = $apph->create_db_obj;
  Returns - L<GO::Model::DB>
  Args    -
```

### create\_association\_obj

```
  Usage   - $association = $apph->create_association_obj;
  Returns - L<GO::Model::Association>
  Args    -
```

### create\_gene\_product\_obj

```
  Usage   - $gene_product = $apph->create_gene_product_obj;
  Synonym - create_product_obj
  Returns - L<GO::Model::GeneProduct>
  Args    -
```

### create\_species\_obj

```
  Usage   - $species = $apph->create_species_obj;
  Returns - L<GO::Model::Species>
  Args    -
```

### create\_graph\_obj

```
  Usage   - $graph = $apph->create_graph_obj;
  Returns - L<GO::Model::Graph>
  Args    -
```
