Is there a good way ECS for creating variants of a behaviour like in Java interfaces?

In Java, there are interfaces – I’m not clear on the details (I don’t use Java) but from what I’ve learned, they seem to be "classes for classes": a way to effectively make individual classes "instances" of one overarching class. For example, a "Cup" interface could be implemented by a "Mug" class, a "Glass" class, a "Goblet" class etc. As long as they have the same I/O methods such as fill(), empty() or drink(), they can be used interchangeably.

In languages with duck typing, interfaces are not needed – the language allows for classes to be used interchangeably as long as no invalid properties of methods are referenced. This is another valid was of going about things in OOP. This is how I usually go about things.

My question: how can I create varied behaviour in an ECS if components are data-only? I like to think in terms of first-class functions, but that seems to be taboo since components are not supposed to hold behaviour.

Option 1, have a massive switch or if/else chain in my System:

For example, if I have an AI component with several different behaviours, I could use an integer to define which type of AI to use for that particular entity. It seems a bit convoluted and inelegant.

Option 2, have a separate Component and matching System for each behaviour:

This would be neater in each individual System but as a whole, the program would be a mess. This wouldn’t work because of the large amounts of variation such as hundreds of different guns in a shooter game.

Option 3, use a flyweight-like data structure independent of the Component:

This would mean storing all of the different behaviours elsewhere, and storing a key that a System can use to access the behaviour. This is basically a fancy version of the switch option above, but it seems neater as there wouldn’t be a massive dump of code in the System.

Option 4, creating a complex way of encoding a description of the desired behaviour which the System can interpret:

This seems to be the most overkill of the lot. Unless I have to, or there are significant advantages, I’m trying to stay away from this.

If there’s no other way, I’ll just adopt the methodology of first-class functions as I usually do and just ignore any guidelines about ECS I’ve heard, just for this one case. The problem is, it probably won’t just be one case in the future.

Have I missed any other good options? Is there an industry standard or recommendation? If not, what considerations should I make about which option to choose?

Looking for (even unofficial) duelist variants

As @KRyan told me, it seems like the duelist PrC is a little bit broken. But my party is currently lost in the middle of savages countries far from any civilization and it is very unlikely that I meet any PrC coach before a long time.

I am currently swashbuckler 5/Dragonmark heir 2/duelist 2/blade of orien 1, and I was planning to keep leveling as a duelist for some time. I think this build is not completely unbalanced compared to the builds of my teammates as they don’t put out as much optimization effort as I do. I chose to train the class knowing its flaws, but I considered it was a realistic evolution for a swashbuckler.

Nevertheless, some duelist levels like the 4th: “+2 on reflex saving throws” are really boring, so I am beginning to research additional content about this PrC like official alternative levels or widely acknowledged homebrews.

EDIT: I am specifically looking for optimizations of the duelist class, which from my point of view essentially sums up to “a character with style (like the swashbuckler) using a rapier and no armor and adding INT to AC“. What I am expecting is mostly alternative class levels, either as a few errata or a total redesign. I would rather it being some already well known content so that it would be easier to negotiate it with my DM.

(In case you were wondering, I did try negotiating taking only 3 levels of swashbuckler, but our DM insisted on us taking 5 level on our baseclass before multiclassing. Plus I liked the flamboyance of this type of character and did not want to change it to much. KRyan suggested me rebuilding as Factotum or Warblade but they are from books that are not allowed in my campaign.)

Who decides what PHB variants are in play?

The rules variants presented in the DMG are clearly there for the DM to decide upon.

SOME of the variants in the PHB say that they are the DM’s prerogative. For example, VARIANT: CUSTOMIZING ABILITY SCORES (PHB p.13) says "At your Dungeon Master’s option, you can use this variant for determining your ability scores."

However, the VARIANT: ENCUMBRANCE (PHB 176) says "Here is a variant if you are looking for more detailed rules for determining how a character is hindered by the weight of equipment." AFAICT, there is no discussion of encumbrance in the DMG.

Does this mean that, RAW, individual players each decide whether or not they are using the encumbrance rule, and that a given game might have some players using the variant rule and others not?

(I realize that by Rule 0, A DM could decide that the variant rule was in play or not)

How does the UA Revised Ranger’s “Greater Favored Enemy” interact with “Favored Foe” from the UA Class Feature Variants?

If a Revised Ranger chooses to use the Favored Foe variant from the most recent Unearthed Arcana, they replace their original Favored Enemy feature. How does this interact with their existing Greater Favored Enemy feature?

Even when the Ranger doesn’t have access to Favored Enemy, do the benefits it provides still apply to the Greater Favored Enemy?

Favored Enemy (original)

Beginning at 1st level, you have significant experience studying, tracking, hunting, and even talking to a certain type of enemy commonly encountered in the wilds. Choose a type of favored enemy: beasts, fey, humanoids, monstrosities, or undead. You gain a +2 bonus to damage rolls with weapon attacks against creatures of the chosen type. Additionally, you have advantage on Wisdom (Survival) checks to track your favored enemies, as well as on Intelligence checks to recall information about them. When you gain this feature, you also learn one language of your choice, typically one spoken by your favored enemy or creatures associated with it. However, you are free to pick any language you wish to learn.

Favored Foe (variant)

You can call on your bond with nature to mark a creature as your favored enemy for a time: you know the hunter’s mark spell, and Wisdom is your spellcasting ability for it. You can use it a certain number of times without expending a spell slot and without requiring concentration a number of times equal to your Wisdom modifier (a minimum of once). You regain allexpended uses when you finish a long rest. When you gain the Spellcasting feature at 2ndlevel, hunter’s mark doesn’t count against the number of ranger spells you know.

Greater Favored Enemy (original)

At 6th level, you are ready to hunt even deadlier game. Choose a type of greater favored enemy: aberrations, celestials, constructs, dragons, elementals, fiends, or giants. You gain all the benefits against this chosen enemy that you normally gain against your favored enemy, including an additional language. Your bonus to damage rolls against all your favored enemies increases to +4. Additionally, you have advantage on saving throws against the spells and abilities used by a greater favored enemy.

(emphasis is mine)

Would it be possible to get a dragon to CR27 using only official material and variants (Shadow Dragon/Dracolich, innate spellcasting, etc.)? [on hold]

Ancient Gold Dragons and Ancient Red Dragons have a CR of 24. This means that, if you were to have such a dragon of the innate spellcasting dragons variety (MM p.86), they could know spells up to 8th level. I’m wondering if it would be possible to get a dragon up to CR27 (to give it access to 9th-level spells) using only official materials and variant rules.

By my calculations, an Ancient Gold Dragon has a defensive CR of 25 and an offensive CR of either 22 or 23, giving it an average CR of 24. In order to get it up to an average CR of 27, the easiest route would most likely be by raising its OCR, as it has more room for improvement. In order to get it to CR27, its OCR would need to be at least 28. The Ancient Gold Dragon gets a +2 boost to its OCR due to having an exceptionally high attack bonus, meaning its damage output would need to be equivalent to CR26, which is 231-248 damage per round on average over the first three rounds of combat.

As far as I know, making the dragon a Shadow Dragon or Dracolich doesn’t significantly increase its damage output. A Shadow Dragon’s breath weapon is more lethal due to instantly killing upon dropping a character to 0, but I don’t know how to quantify that.

Is there a selection of spells of levels 1-8 that could be given to a dragon in order to get its OCR up to 28? Or is there another way to get a dragon to CR27 that I’m overlooking?

Bloodline Mutation Variants & Transmutation

Looking at the Sorcerer Bloodline Mutation Variants from Paizo’s Magic Tactics Toolbox. Do either of the three variants (Havoc, Intensity, or Piercing) have any effect while ‘you’ are under the effects of a transmutation/polymorph spell?

Are there any other Mutations (or similar variants) that have been published that would affect being polymorph as such?