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

1 Answer 1

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).

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you darijan. They are java classes yes. I will checkout the links.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.