Anyone know how to get starting with understanding how to create apps that allow modding?

20 views
Skip to first unread message

Thomas D'Andrea Jr.

unread,
Jun 28, 2012, 2:08:39 PM6/28/12
to coll...@googlegroups.com
I want to start developing some apps to understand a bit more about a couple languages, and I want to be able to then create other apps to plug in, mod, or add modules onto the original app. Not really sure how to do that though, does modding just expose public commands or classes for the modder to use?
 
Tommy

David Morrison

unread,
Jun 28, 2012, 2:16:23 PM6/28/12
to coll...@googlegroups.com
Tommy,
In .NET you could check out the Managed Extensibility Framework.

Here is Code Project example of a calculator, where each operation is a new DLL file that is plugged into the app:  http://www.codeproject.com/Articles/188054/An-Introduction-to-Managed-Extensibility-Framework 

It's a bit abstract to think about at first, but I'm currently working on a project that uses it to import files in various formats. New import formats are added by adding new components to the application.


On Thu, Jun 28, 2012 at 2:08 PM, Thomas D'Andrea Jr. <thomas....@gmail.com> wrote:
I want to start developing some apps to understand a bit more about a couple languages, and I want to be able to then create other apps to plug in, mod, or add modules onto the original app. Not really sure how to do that though, does modding just expose public commands or classes for the modder to use?
 
Tommy

--
You received this message because you are subscribed to the Google Groups "Collexion" group.
To post to this group, send email to coll...@googlegroups.com.
To unsubscribe from this group, send email to collexion+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/collexion?hl=en.

nx

unread,
Jun 28, 2012, 2:46:35 PM6/28/12
to coll...@googlegroups.com
Yeah, I like to think of modules as things conforming to a public API.

You'll want to start by creating a public API for your mods to expose.

In Erlang the adapter pattern is common:

DBAdapter = db_mysql_adapter,
DBAdapter:save(Thing),
DBAdapter:delete(Thing),
DBAdapter:update(Thing).

Where DBAdapter could be the name of any module that exposes the
methods save, delete, and update.

If you want to have a mod framework where you install a mod that
affects your core application, then you'll want your core app to run
some code that will search a specified directory (i.e. "modules") for
all of your mods and execute methods or functions on them. If the mods
conform to your special API your core app will be able to access and
initialize stuff on them whenever they're in the modules directory.

On Thu, Jun 28, 2012 at 2:08 PM, Thomas D'Andrea Jr.
<thomas....@gmail.com> wrote:

Todd Willey

unread,
Jun 28, 2012, 2:55:53 PM6/28/12
to coll...@googlegroups.com
The mechanisms for doing this vary by language.

In java you can implement your own ClassLoader, and use the reflection
api to discover things about the classes that are being loaded, and
add those things into the existing call chain as desired.

In ruby you can just require gems that re-open classes and exploit the
dynamic nature of ruby to replace or hook into an existing method
call.

You can create APIs that you expose to runtimes (python, lua, &c.) and
then embed a scripting language into your existing project.

You can also be language agnostic and use a messaging queue or similar
mechanism to publish data and intents, and have listeners (in any
language) on those topics that pick up the data and perform the
actions. Then you only have to swap out particular processes
listening on specific topics (like "compute-gcd") to change your
behavior for that particular intent.

-todd[1]

Noah Adler

unread,
Jun 28, 2012, 4:43:13 PM6/28/12
to coll...@googlegroups.com
Todd, can you give some concrete examples of the abstract messaging queue in the wild?  I've seen some systems which propose this, but imho it seems like the additional complexity of managing a polyglot system tends to put off newcomers and projects lose traction.  Where would this be more valuable than a technique that riffs on the idioms of the specific language?

I did something similar in an older version of .NET, and it amounted to basically defining a set of interfaces in one assembly, and referencing that from the main executable's [obfuscated] assembly.  So plugins would just need to create another assembly referencing that interface.  Then, as with Java, use the reflection capabilities to instantiate the plugins.

For what it's worth, Drupal goes an entirely different route, and uses a hook system which is purely based on convention.  Certain 'hooks' are documented, such as 'hook_node_save', and any module is free to implement a callback by simply defining a function something like 'modulename_node_save'.  A lot of people seem to like this or find it intuitive.

Tommy, what languages in particular are you looking at for this?

cheers,
noah

Todd Willey

unread,
Jun 28, 2012, 9:17:29 PM6/28/12
to coll...@googlegroups.com
On Thu, Jun 28, 2012 at 4:43 PM, Noah Adler <noah....@gmail.com> wrote:
> Todd, can you give some concrete examples of the abstract messaging queue in
> the wild?  I've seen some systems which propose this, but imho it seems like
> the additional complexity of managing a polyglot system tends to put off
> newcomers and projects lose traction.  Where would this be more valuable
> than a technique that riffs on the idioms of the specific language?

If you don't have concerns about using multiple languages or having to
scale components individually, then you can get away with whatever
your language of choice recommends. I brought it up since Tommy
mentioned multiple languages.

Concrete examples would be pretty much anything covered on
http://highscalability.com/

William Dieter

unread,
Jun 29, 2012, 9:19:34 AM6/29/12
to coll...@googlegroups.com
If you are looking for message queuing systems to play with ActiveMQ (http://activemq.apache.org/) or ZeroMQ (http://www.zeromq.org/) are two examples.

At the last company I was at, we used ActiveMQ. We had a customer using Active Directory (AD) for authentication. Part of our application ran on a VPN that did not have access to AD and we used ActiveMQ to make authentication requests to server processes running on the parts of the network that could talk to AD. The advantage of ActiveMQ over TCP sockets is that the AD authentication server query process could run on multiple hosts and only one of them had to be up to serve the request.

Of course, we could write our own code to poll multiple servers, but that is more work, which someone has already done in ActiveMQ.

Bill.
Reply all
Reply to author
Forward
0 new messages