📜  您在框架中的哪里使用抽象 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:46.458000             🧑  作者: Mango

代码示例2
I used in defining a common super class while writing POM layer of the framework
We usually create an abstract class named
BasePage to have all common members for every page written
in this class like getPageTitle().
Then each Page class (HomePage, LoginPage, DashboardPage
etc.) inherit from BasePage.
Sometimes one may need to change the behavior of methods
implemented in superclass. So, subclass has freedom to
override that method where we use polymorphism.
This is how we use Abstract class in real projects