function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alper OzdamarAlper Ozdamar 

Inheritance and Polymorphism

Hello,

I'm experienced Java developer but I'm brand new in Salesforce environment. I have couple of questions related with object oriented architecture. 
I want to design a notification system with Apex code to send email and text messages. I have different scenarios that user create different objects (Appointment, Referral, Task, etc.) and I need to send a Notification for each of them. 
So I think that I need to create a Notification super class and AppointmentNotif. ,ReferralNotif. ,TaskNotif. subclasses which are extended from Notification super class. (I can put common attirbutes to my SuperClass.) And some NotificationManager class can have sendNotification method add gets Notification object as a parameter. So NotificationManager doesn't care about it is a Appointment,Referral or etc. if it is a subclass of Notification object. (polymorphism.) 

As a result , my first question is :
1) In Salesforce and in Apex environment can I design my classes like I did in object-oriented architecture.
2) Does Salesforce encourge me to that or Will I experience hard time to do that ? 

Thanks,

Alper