In a interview I was asked,Suppose we are going to create a software that runs on both desktop machines and smartphones. Name a software design pattern that could be used to enable the application to create different classes for display at runtime depending on the platform.I know there are simple solutions to implement this feature in the actual code. For example, in Java I can check the display size and create the suitable class (MobileDisplay or DesktopDisplay class) for that display. But I don't how this is related to the software design; in my opinion, creating suitable class based on runtime platform is an implementation concern rather than a software design issue.
A software design pattern to model runtime-dependent behavior
design patterns;application design;engineering