Jump to content

Module Extensions (i.e.: alternate data providers, services, functionality)


BrendonKoz
 Share

Recommended Posts

Is there any established or suggested way of how to handle providing modules that offer functionality from different providers?

Example:
Let's say the Google Maps and Leaflet Maps modules didn't already exist. Someone thought to create a module, but realized future clients may want one provider over another. Because they're so functionally similar, created a base module that then offers classes (GoogleMap / LeafletMap) to extend the base (Map) class - which can be chosen either in the module configuration or in the field configuration.

I've seen a few different modules that offer this functionality over the years - most recently Ryan's Tfa (Two-Factor Authentication) class. Ryan's WireMail and Tfa base classes have a distinct benefit of being part of the core and therefore don't need to be installed or initialized - only the modules that extend them do, so I'm not entirely sure if custom modules requiring the installation of a base module, and then offering extension modules is the best solution. Other solutions are to add folders (or classes) containing required module extensions that will be discoverable by the main module. I think I saw one that used a JSON configuration at one point in my research too.

Any thoughts from others who might've handled this for their own custom modules - or have been thinking about this recently?

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...