Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Unknown macro: {remotion-mixins-disclaimer}
This tutorial...

...has its focus on how to use re-motion mixins. It is not supposed to be a general introduction on the whys, why nots and whens of mixins. Such a backgrounder is in the works but not here yet.

For this reason, the examples used for illustration are not fully convincing, because they are actually too simplistic for re-motion mixins. The code samples illustrate how to use re-motion mixins, not when to use them. re-motion mixins shine in large, complicated architectures, because re-motion mixins give you a flexible tool for slicing and dicing code across arbitrary axes. Distributing code along inheritance hierarchies is useful, but most non-trivial domains are too messy to be mapped across trees of ancestry.

The potential for abuse is significant, because re-motion mixins can provide convenient alternatives for various design patterns and well-thought-out architectures. Some people will like that more than others; some of them will be liked more than others by their maintenance programmers. For the time being, such issues are beyond the scope of this tutorial, but any report from the field or thought is welcome.

What you see in this tutorial is LESS you get, by the way. Not all features of re-motion mixins are covered by this tutorial yet. If you run into problems or think "I wish, re-motion mixins could do...", don't hesitate to ask if your particular desire has not been implemented already. Send email to cm@re-motion.org.

re-motion mixins are part of re-motion

The re-motion mixins library is part of the larger re-motion web framework. No separate assembly exists for it, because re-motion mixins depends on
various utilities that comprise re-motion's core and reside in the Remotion.dll assembly and its interface assembly Remotion.Interfaces.dll.

re-motion mixins can be used without the rest of re-motion, but at this time you have to prevent the compiler from erroneously removing the all-important reference to the Remotion.dll assembly. (See "Use force" below.)

Third-party libraries

re-motion require three extra DLLs

Sample code

The sample code of the tutorial is located at

https://svn.re-motion.org/svn/Remotion-Contrib/Samples/Mixin/WikiSamples/

The two assemblies - Remotion.dll and Remotion.Interfaces.dll - is located in the lib sub-directory.

Versions

The re-motion mixins tutorial assumes re-motion version 1.13.6., the same as the PhoneBook tutorial. All sample code should work with subsequent versions just as well. At the time of this writing, the most recent version of re-motion is 1.13.35.

Use force

In the code samples in the tutorial, we use the (more or less arbitrary) line

FrameworkVersion.RetrieveFromType (typeof (IMixinTarget));

This line has no function except for giving the compiler a reason to keep the reference to Remotion.dll for loading.

If you don't do this, you will get the following exception: re-motion mixins TypeInitializationException

API reference available, but...

The re-motion framework, and this includes re-motion mixins, comes with a good API reference. The bad news is that currently there is no web version of it. You have to resort to a single .chm file generated with NDoc (part of NAnt). For this reason, no links to API documentation can be provided. You find the re-motion online help (for 1.13.6) here.

"re-motion mixins" – plural problems

In rubicon parlance, the library is named "re-motion mixins", what suggests a plural. However, "re-motion mixins" is commonly used as a brief form of "re-motion mixins library", what requires the singular. In this tutorial, we stick to rubicon's convention and inflect to "re-motion mixins"'s singular, i.e. "re-motion mixins IS", not "re-motion mixins ARE". Other examples for such a convention exist, the most famous is "The United States of America".

From wikipedia:

The phrase "the United States" was originally treated as plural—e.g., "the United States are"—including in the Thirteenth Amendment to the United States Constitution, ratified in 1865. It became common to treat it as singular—e.g., "the United States is" – after the end of the Civil War. The singular form is now standard; the plural form is retained in the idiom "these United States".

At rubicon, no civil war was required to establish the singular inflection for a plural word.

Back to the table of content: [re-motion mixins#The re-motion mixins tutorial]

  • No labels