Interface for classes that have nothing in common

Posted by Tomek Tarczynski on Stack Overflow See other posts from Stack Overflow or by Tomek Tarczynski
Published on 2010-03-24T22:38:33Z Indexed on 2010/03/24 22:43 UTC
Read the original article Hit count: 355

Lets say I want to make few classes to determine behaviour of agents.
The good practice would be to make some common interface for them, such interface (simplified) could look like this:

interface IModel
{
     void UpdateBehaviour();
}

All , or at least most, of such model would have some parameters, but parameters from one model might have nothing in common with parameters of other model.
I would like to have some common way of loading parameters.

Question

What is the best way to do that?
Is it maybe just adding method void LoadParameters(object parameters) to the IModel?
Or creating empty interface IParameters and add method void LoadParameters(IParameters parameters)?
That are two ideas I came up with, but I don't like either of them.

© Stack Overflow or respective owner

Related posts about interface

Related posts about language-agnostic