Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Required skills: Python
Difficulty: Hard
Motivation
During the data conversion, the converter generates so-called export requests (
MediaExportRequest) for media files. Currently, export requests store the filepaths for the source file and the to-be-generated target file as well as asave()function.save()is used to read the source file, convert it to a media format readable by openage and write the result to a file. For every media type, there is a subclass ofMediaExportRequestwith its ownsave()implementation.There are problems with handling
save()in theMediaExportRequestimplementation: There can be a number of intermediary conversion steps between reading the source file and writing the target file, e.g. texture packing for graphics files. In the worst case, this can lead to a convoluted chain of operations with a workflow that is very hard to understand. For example, it can result inMediaExportRequest'ssave()function, calling thesave()function of an intermediary format, which also callssave()on a subformat... We also run into the risk of creating circular dependencies and spaghetti code when extending the implementation.Task
To adress these issues, the
save()functionality should be implemented in a dedicated processor rather than inMediaExportRequestor any intermediary subformat. Instead of a convoluted chain, the processor function should have a linear workflow. All intermediary conversion steps should be initiated by the processor function.The workflow should look like this:
MediaExportRequestMediaExportRequestwould be reduced to a storage format for information used by the processor.