Practical Example for Abstract Classes
using System; namespace AbstractClasses { public abstract class Messager { protected string _recipient; protected string _message; public Messager(string recipient, string message) { _recipient = recipient; _message = message; } public void ProcessMessage() { LogMessageLength(); // the code from here var isValid = false; if (ValidateRecipient()) { isValid = true; SendMessage(); } // to here will be implemented by the concrete classes if (isValid) NotifyTheServiceOwner("The message was correctly sent"); else NotifyTheServiceOwner("The message was NOT sent"); } protected abstract void SendMessage(); protected abstract bool ValidateRecipient(); private void LogMessageLength() ...