Hi team,
I have trying to understand the concept of abstract class and method to use in D365FO. So, what I understood…
An abstract class is used when we want to define a base class that should not be instantiated directly.
It is typically used when we like to share common functionality in multiple derived classes.
For example -
Suppose we have different types of customer notifications. The common logic we can be placed in an abstract base class, while each derived class implements its own notification method respectively.
Abstract base class -
public abstract class CustomerNotification
{
public abstract void sendNotification();
}
Derived class-
public class EmailCustomerNotification extends CustomerNotification
{
public void sendNotification()
{
info("Customer notification sent through Email.");
}
}
Derived class -
public class SmsCustomerNotification extends CustomerNotification
{
public void sendNotification()
{
info("Customer notification sent through SMS.");
}
}
Am I correct?
Pls advise, thanks

Report
All responses (
Answers (