Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

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

Posted on by 1,638

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?

  • Ray Profile Picture
    Ray 1,479 on at
    RE: Needs to discuss about the best practices to write a plugin for Dynamics 365

    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.

  • a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Needs to discuss about the best practices to write a plugin for Dynamics 365

    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.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans