What design pattern should I use for specific multiple inheritance?
DynamicSquid

Let's say I have an interface called Squid.

And we have a bunch of different types of squids:

Here's everything a squid can be:

aquaticland
basicbasic-aquaticbasic-land
advancedadvanced-aquaticadvanced-land

How would I go about create an instance of a squid? Should I go about creating 4 classes BasicAquaticSquid, BasicLandSquid, AdvancedAquaticSquid, AdvancedLandSquid like this:

I think that's called the Abstract Factory method? It seems very tedious though. Any better way of doing so?

Thanks

You are viewing a single comment. View All
Answered by xxpertHacker [earned 5 cycles]
View Answer
xxpertHacker

@DynamicSquid To that, I must ask you the following:

In a strongly-typed, and statically typed language, should type safety be the programmer's fault, or the language's fault?

Should you run a compiler on a text file, and get a properly working executable, or an improperly-working executable?

Should source code that was developed on a Windows computer be capable of being compiled on a Linux, and run just as it had done on the Windows, without change?

Should undefined behavior be allowed to even exist?