Closed bodokaiser closed 10 years ago
1. + 2. + 4. Taking a look at the smtp package from go it seems legit to put this all into the constructor. According to that example the constructor could look like:
func NewXYStore(s *mgo.Session) (*XYStore, error) {
s := &XYStore{
m: mongo.NewStore(s, XYConfig),
}
s.m.AddListener("preSomething", s.preSomething)
return s, s.m.Index()
}
3.
Could just be done by some func (s *XYStore) OpenFile(model interface{}) (io.ReadWriteCloser, error)
handle?
5. + 6. ???
Separate file store from document store? Yes. Requires good names, possible name store.DocumentStore
and store.FileStore
.
Regarding 3. we could use a special store.File
type which has a Open()
method. Needs some deeper thoughts as this may bring some overhead.
Also #30 suggests adding construct methods for the basic models store.Customer
, store.Order
, store.Product
.
New ideas:
Discussion is proceeded in #42.
Fixes #15 and #37. Interface design happens here.
Current design issues are:
mgo.Session
?