Changed the way that the getLocationById function works by writing in an Adapter design pattern. I moved around the functionality of the getLocationById function in order to be able to follow the pattern.
This enables the program to fit into any format that is thought of in the future. If the output from getting location data is wished to be changed, then the adapter pattern allows for this to be possible with minimal changes in the code.
The three new classes fit in a pattern format where one Adapter class can change the style of output from the current form to a wished format in the TargetOutput class.
Changed the way that the getLocationById function works by writing in an Adapter design pattern. I moved around the functionality of the getLocationById function in order to be able to follow the pattern.
This enables the program to fit into any format that is thought of in the future. If the output from getting location data is wished to be changed, then the adapter pattern allows for this to be possible with minimal changes in the code.
The three new classes fit in a pattern format where one Adapter class can change the style of output from the current form to a wished format in the TargetOutput class.