0

Jar base_app contains classes:
BasePage
HomePage
MenuBar
SigninPage

BasePage imports HomePage, MenuBar and SigninPage


Project my_app includes jar base_app
Project my_app has a class that extends HomePage
Project my_app has a class that extends MenuBar
Project my_app does not extend BasePage and SigningPage from base_app (parent jar)

How can BasePage class be setup to allow for runtime inheritence where basepage first looks for a "subclass version" of HomePage if not found use HomePage from the base_app jar

Cœur
  • 37,241
  • 25
  • 195
  • 267
MMM
  • 11

1 Answers1

1

If all those names you listed are java class names then there is no way to do it in the setup that you mentioned.

Base app has to be reworked in order to fully enable Dependency Injection (see: https://en.wikipedia.org/wiki/Dependency_injection) and to favor composition over inheritance (see: Difference between Inheritance and Composition).

Community
  • 1
  • 1
darijan
  • 9,725
  • 25
  • 38