In my application I fetch files from the user and process it.
Im to limit to a certain scope of file types and each one of these has a different processing approach.
How can I design the application in order that when a new type of file is added, I have to change few to no lines in the controller classes.
Should I be using an Adapter? Wouldn't that be just delegating change responsabilities to another class?
Should I make a representative class for files and deal with them that way?
If possible, provide a (generic) implementation example. It might help to know that Im designing a Spring MVC application and loading files with multipart files. Also, Im checking file type through extension name in the loading file controller [this might have to change].
process
) and havr concrete implementations of this interface for each file type. You will then have a factory method returning you a concrete instance of said generic interface based on the type of the file you are trying to open.