Jump to content
We've recently updated our Privacy Statement, available here. ×
  • How to choose between using IronPython scripting and creating a C# Extension when developing for Spotfire®


    All about the Spotfire .NET client API Both IronPython entered into Spotfire® as a script and C# code deployed to the Spotfire® client application through Spotfire's extension system ultimately act on the Spotfire .NET client API, and therefore can often be used to perform similar tasks, and can sometimes seem to be able to be used interchangeably.

    All about the Spotfire .NET client API

    Both IronPython entered into Spotfire® as a script and C# code deployed to the Spotfire® client application through Spotfire's extension system ultimately act on the Spotfire .NET client API, and therefore can often be used to perform similar tasks, and can sometimes seem to be able to be used interchangeably.

     

    converted-file.png.e11eea501a7a3e4cc2c618856a695592.png

    So when should one be used in favor of the other? Depending on the requirements for various aspects of development process, power, distribution mechanism and use case one might end up with one or the other or both, as they were created with separate purposes in mind.

    Horses for courses

    IronPython's raison d'être is to provide a light-weight way of adding sophisticated behavior to the analysis itself.  It facilitates the creation of an easy to use powerful analysis application without the need for separate development tools or deployment mechanisms, which will, in many cases, result in a fast initial development time. Enter the script directly into the specific the analysis, wire it up to run when buttons are clicked, or document properties change, and a small application has been created.

    When creating a rich UI, where the user's interacting with buttons in the text area or similar controls are needed, these will need to be wired to IronPython script. For this use case, it would be near impossible to create a rich user experience depending on the C# extension mechanism alone.

    converted-file.png.4837d0fe93e06c52f8e1a34c10cab5f3.png

    On the other hand, the extension mechanism using C# and the Spotfire add-in system has a slightly different raison d'être, as it allows a developer to create and add functionality deeper into the Spotfire client software itself. This can be custom visualizations, data sources or other such items, depending on what extension point has been used.

    This functionality, once deployed to the client deployment area can be automatically be made available to all concerned Spotfire users through the Spotfire deployment mechanism. Using the Spotfire packages as deployment mechanism also allows for inclusion of any redistributable 3rd party .DLL:s that the solution may be dependent on, something that a pure IronPython solution would not be capable of doing.

    If there is a need to create new custom functionality to be added to Spotfire as indicated by the yellow arrows below, the C# extension mechanism should be used.

    converted-file.thumb.png.1657785657d42badc3040908817f5cb4.png

    For creating polished user experiences IronPython will go a long way, as it is more suited to using existing functionality (custom or not) and automating complex or tedious tasks. For deep customization of Spotfire, adding of functionality and software-to-software integration with 3rd party software, the C# extension is likely a good candidate to explore.

    Further reading


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...