Sumitra Paul

Sumitra Paul

  • NA
  • 51
  • 33.7k

Interface related design question

Feb 19 2013 11:28 PM


Hi,

I am very week in design and program to interface. I have a task to design few classes. I have some simple interfaces
like below. Sample interfaces.


 public interface IParameterValue
    {
        string ParameterName { get; set; }
        string ParameterValu { get; set; }
    }

the above interface is a kind of common interface.

The below interfaces should actually implement the above interface.

Area Parameter interface:

public interface IAreaParameter
    {
        string AreaId { get; set; }
    }

    public class AreaParameter : IAreaParameter
    {
       public string AreaId { get; set; }
    }

Plot paramtere interface:

 public interface IPlotParameter
    {
        string AreaId { get; set; }
        string PartId { get; set; }
    }

    public class PlotParameter : IPlotParameter
    {
        public string AreaId { get; set; }
        public string PartId { get; set; }
    }


Now the common interface IParameterValue has ParameterName and ParameterValu.
There will be one more incoming value scope. depending on the scope
the paramterValu will be applied Area wise or Plot wise.


Now, I think we have to implement IParameterValue interface to IAreaParameter and IPlotParamter.
My question is, how to implement in code and if we implement how to access all this paramters
from other class and assign a value to them.

Simple question i think but did'n work with interfaces more so...

Thanks.


Answers (11)