If I write a tic-tac-toe game that allows a programmer to change the algorithm or board pieces, is this a pluggable architecture?

StackOverflow https://stackoverflow.com/questions/22507886

  •  17-06-2023
  •  | 
  •  

Question

Say I make a tic-tac-toe game, and I use minimax to play a human/computer opponent. Some other guy comes along with a new decision making idea, expressed in code. If I create some way for him to use that algorithm instead of my stock one, without changing my original code, does that mean I have created pluggable software (isn't that new search routine a plugin)? Also, what if I make it so someone can write some way to change the pieces? Is that skinning or pluggable or both?

Thanks.

Was it helpful?

Solution

I usually distinguish between

  • Loosely coupled architecture
  • Plug-in/Add-in architecture

The difference is mostly in cardinality.

Let's say that you define the AI algorithm in an external library, and provide a way for a user to replace the algorithm without recompiling the original application, you have a loosely coupled application.

I've seen this done in shrink-wrapped enterprise software, where you can change the data access layer to talk to either SQL Server or Oracle. Still, it's one or the other.

A Add-in Architecture, on the other hand, is an architecture where the application may come with some default functionality out of the box, but it enables users to add zero or many different behaviours. Sometimes, there's an additional UI element that then lists the various options; an example would be various image processing filter plug-ins for Photoshop. I prefer the term Add-in over Plug-in, exactly because it defines the goal as being able to add behaviour to the application, instead of just replacing it. (Sure, Plug-in sort of signals that too, but I think Add-in is a bit more explicit.)

If you can change the way an application looks, we normally call this skinning, but you could argue that it's just a special case of plug-in architecture.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top