In reply to @demotomohiro "Do you want to": Almost, more like this, in separate files: type Entidade = ref object of RootObj id: int DAO  [E : Entidade] = ref object of Entidade dados: seq[E] DAOProduto  = ref object e : Entidade instance: DAOProduto dao : DAO[e]