It sounds like you are (re)writing an Asset Management System? "Project" would probably be a concrete final class, and not have subclasses such as "Character". For that, you might have a base class called "Asset", where every asset type subclasses it. Assets would all have a reference to a project.
Is there a reason you are using text files for all the records in your system? Does that mean for every query you want to make, you have to have each client scan the file system to piece together the results? That would be pretty slow, and also hard to maintain when people are making concurrent updates to the system. What happens if I am editing the project file at the same time as someone else, to change a value. We both have to save the entire file out again, so one would clobber the other complete file. What about using a database and storing it all in one place that can be queried much more efficiently? That would easily allow you to maintain asset that have foreign key relations to projects and do stuff like "Give me all assets where project is FOO" On Oct 29, 2013, at 8:47 AM, David Martinez wrote: > Hi, > > I'm trying to re-write part of our system to take advantage of Python's > Object Oriented Programming but I'm not entirely sure on how to go about it. > I'll explain what is it that I'm trying to achieve and what my first thoughts > are but any feedback/advice is more than welcome. (Game Development) > > The way I see it, we should have a main type of object (Project) and subclass > from that class to have classes such as 'Character', 'Object', 'Cinematic' > and so on... > > The 'Project' kind of object should encapsulate data (such as list of > objects, characters, cinematics, etc) as well as functionality (such as 'get > cinematics list from current project', 'get character list from current > project' and so on. The other kind of objects will contain information about > where the Maya file for those character/objects/cinematics are as well as the > path to their export for the game. The path of the project will exist within > the 'Project' object where the other objects will create paths relative to > that one. > > I'd like the system to work both ways. That means that having a 'Project' > object would allow you to get information about all it's data but also, I'd > like to be able to get the project when opening the file of a character, > object, cinematic etc... Does that make sense? > > The goal behind all of this will be to be able to manage great amounts of > data without having to remember all the paths and files containing > information. > > Here are some of the objectives that I'm trying to hit: > > - The system should allow for several projects. > - The data within a project is split in two branches with the same folder > structure structure (Source/Exported). That means that when working on a > file, I should be able to know where its export is (if it exists yet). > - Heavy usage of text files (would prefer XML but the system is already there > and text files are easy to parse) > > Does that sound like a good idea to you? Even though that we have a few tools > using procedural programming, I think that there is a good oportunity to link > everything together using OPP but I'd like to get your take on it. > > Many thanks, > > > Dave > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/19c21723-5511-49c7-9da0-721b2556cf2e%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/97692863-9B7D-4B28-B013-854E9DCDBE19%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
