web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Needs to discuss about the best practices to write a plugin for Dynamics 365

(0) ShareShare
ReportReport
Posted on by 2,100

Hello Everyone,

Hope you are doing well.

This discussion is regarding to write a plugin code in one .cs file or multiple .cs file.

We have seen that many developers are using only one .cs file to manage the code of all the messages of the entity. At the other hand some of the developers are creating more than one .cs file based on the Message. Could anyone confirm what should be the best practice to manage the Plugins?

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    In my opinion - one plugin - one class, one cs file.

    Where there could be a common base - I use base classes and put all the shared elements in it and inherit plugin classes from it.

  • Ray Profile Picture
    1,537 on at

    One file compare with multiple files:

    Advantages:

    1. Less plugin can cause less conflict in plugin registration.

    Disadvantages:

    1. Hight coupling.

    2. Less flexable

    3. Need consider deepth, order, trigger point, async/sync, etc.

    So i vote for multiple files.

    BTW, you can find the OOTB plugin in plugin registration tool and see how they do it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans