Multi Methods Discussion

There is some discussion of MultiMethods on ObjectFunctionalDiscussion discussion which has been moved here.


If you are aiming to support DomainModelling with ObjectOrientedProgramming, then MultiMethods are a reasonable option for that goal.

But I do suggest you take a step back and carefully examine the assumptions that lead you to this goal. For example: why do you assume you are stuck with ObjectOrientedProgramming? The fundamental goals of modeling include things like: "make useful and accurate predictions", "derive interesting information", and "support planning and problem-solving". Even with MultiMethods, ObjectOrientedProgramming will be ill-suited to modeling goals, if only because such methods still have SideEffects and are generally irreversible. And those MultiMethods are not free: they require violating various forms of encapsulation that make ObjectOrientedProgramming suitable for ModularProgramming and independent testing. If you aren't careful, the end result of adding MultiMethods to ObjectOrientedProgramming will be a language barely suited for anything at all.

OTOH, if you don't assume support for the DomainModel must be an enhancement to OOP, then other options open for you. Now, the goal doesn't change - we still wish to integrate some domain code into the programs. But MetaProgramming, i.e. via use of an EmbeddedDomainSpecificLanguage or DomainSpecificTweaks, might be quite suitable for this purpose. Alternatively, one could aim to integrate another paradigm. Those well suited to domain modeling include TermRewriting/RewriteRules, LogicProgramming, ConstraintLogicProgramming, and RelationalModel. ComplexEventProcessing, DataflowProgramming, and FunctionalReactiveProgramming are also useful as they can efficiently integrate modeling and communications. Of course, if integrating another paradigm one must be careful to avoid weakening the properties of either; for this purpose, I would suggest a 'layered' approach rather than a 'hybridized' approach.

Incidentally, the topic of how to implement operator overloading so that a user can write mixed expressions

 a = b + c

where all three objects are of different types is of interest to me. -- JohnFletcher


Thank you for this interesting contribution, which was at risk of being lost in ObjectFunctionalDiscussion, one of the LongPages. I have moved it to a new page MultiMethodsDiscussion with a reference from there. -- JohnFletcher

I wrote the above in response to this relatively fresh section. I'm not sure it is related to ObjectFunctional; the discussion on MultiMethods seems a divergence from the original topic. Copying any interesting bits to MultiMethods might be reasonable. But, with the way WikiWiki is right now, I suspect anything written here is at risk of being lost.

Don't despair. Quiet building continues. A lot of this wiki is like a castle with closed off rooms with echoes of past conversations. Some of them I took part in and can remember, some I can only guess at.


CategoryLanguageFeature CategoryPolymorphism


EditText of this page (last edited April 5, 2010) or FindPage with title or text search