Implementing marker interface IShell seems redundant and can be removed

Topics: Bootstrappers & IoC
Jan 26, 2012 at 1:31 PM

Hello,

Im using CM on my second project and it works well. 

Its still not clear to me if the root viewmodel has to implement IShell (which is an empty interface, a marker)

[Export(typeof(IShell))]public class ShellViewModel : IShell

Why do I ask this? Because my app works just as well if I don't :

[Export(typeof(IShell))]public class ShellViewModel

The :IShell got added by the nuget installer. Is it ok to remove it since I only want to see code that matter (no dead code)

Kind Regards, Tom


Coordinator
Jan 26, 2012 at 5:14 PM

It's really only meaningful if you give your shell functionality that is consumed by other objects.

Jan 27, 2012 at 8:36 AM
EisenbergEffect wrote:

It's really only meaningful if you give your shell functionality that is consumed by other objects.

But in this case, I would have to define a new interface to permit access to that functionality anyway. But to me, it is fine as a marker interface, even if it just for documentation purposes. I like the metamodel behind Caliburn with Shell, Conductors, etc. as it helps me to explain the structure of the UI to others. Finding these concepts in the source supports understanding the code.

Lars