Why the plugins implement IPlugin interface and Workflows (custom) inherits the Code Activity abstract class

Microsoft Dynamics CRM/365 by Vishal Grade

Someone asked me this question which is frequently asked in interviews i.e. why plugins implemented iplugin i.e. an interface and custom workflow inherit codeactivity i.e. an abstract class?

The purpose of question is to know why codeactivty is an abstract class and not an interface like iplugin?

So to understand the answer we fist need to understand the difference b/w interface and an abstract class:

What is an Abstract Class?

An abstract class is a special kind of class that cannot be instantiated. So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry…

View original post 300 more words

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.