Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

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

Posted on by 1,654

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,505 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,323 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans