Repository is the place where components are stored as described in XML. Repository provides some APIs, by which the component users can obtain specified component objects. In this version, repository mainly consists of a BTTFactory object and a BTTComponentArray instance. The constructor of BTTRepository is defined as follows.
var BTTRepository = function(factory){ this.factory = factory; this.repository = new BTTComponentArray (); };
The factory attribute stores the reference to corresponding BTTFactory instance. When you create a new repository, you need to pass a new BTTFactory object to its parameter to avoid the duplication of component.