EnzoAeneas
unread,Sep 4, 2009, 8:53:06 PM9/4/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ocal-brows...@googlegroups.com
I made some changes to the basic model, making the Format of a Clip (iClip) into a type itself (iFormat).
This way, format specific information can be gleaned by the Format Provider.
All of the items within the model are abstract classes (Python does not have the concept of interfaces).
All of their functions are implemented with the pass statement.
An implementation of a particular type must subclass the original abstract class or another implementation.
So how does the system know which implementation to use for a particular type or even where to find them?
The classes will be loaded from either standard sub-directories within the executable directory or zip compatible archives (zip, jar, xpi) containing the implementations. These directories and archives will contain manifest files that not only map which classes implement what abstract class type, but also which is class is default for each type.
From this information, static factory classes will return an instance of a requested implementation of an abstract class or the default implementation. These classes can also be instantiated directly as they will be properly imported, but I am sure that certain parts of the viewer will not be able to anticipate what implementation is needed at any one time.
One thing to bear in mind, the relationships between these types is VERY loose. I only define how they fit together, not how they interact. Implementors of these abstract classes, especially the iRenderer and iRenderSink classes, will need to do their own type checking and casting to make sure that they are operating on the proper object type. Atleast for now. I am still a novice at Python so I don't know of any facilities or patterns that loaded up proper class implementations (such as in Java).