[Rbrainz-users] Model factory
phw at rubyforge.org
Mon Jul 16 04:46:44 EDT 2007
I added a factory class for the models. It works mostly as in
PythonMusicbrainz with the following differences:
* DefaultFactory is defined in the Model module.
* There is a method new_entity to create an entity class for a given
There are a few open points I like to discuss:
1. Currently all custom entity classes need to implement entity_type,
since the generic version in Entity uses the class name to return the
entity type. I like to get rid of this but keep the method. I thought
about setting the type in the constructor.
2. What do you think about refactoring Query.new to only accept the
options hash (currently webservice is a separate parameter)
3. Do you think the factory should be able to construct Collections as
well? I think it would be a good idea
4. Does it need to create IncompleteDate and MBID? I think those are
basic data types which don't need to be created by a factory.
More information about the Rbrainz-users