Design patterns

Suppose that you’re creating a public transport application for tourists. The first version of your app can only handle transportation for tourists by buses, (so the bulk of your code lives in the Bus class). After a while, your app became popular and every day you receive many requests from public car owners to incorporate their cars into the application.

Now you decided to add public cars to your app, but you probably need to change your app code. What is the main design pattern that you will use to update your code? Why you choose it? Support your answer by identifying the main classes to be added to the application’s main code (preferable by shape).

This question has been answered.

Get Answer