I have several classes that implement something like an IAdd interface/class:
public class AddClass<T> where T : ISomething
{
//Calculated Properties
//Member Variables
public Add(T t)
{
//do stuff thats complicated
}
}
Now in some instances the t in Add(T t) just needs to be a simple struct with basically input variables; something like:
int ID;
string Name;
int Age;
From there I do some complicated stuff within the Add() method, but once I have 3 three inputs, I don't need anything else. I can probably just use a struct that implements ISomething. Is there a design pattern or anything that relates to this? Do I declare the struct within AddClass? What do I name it? Is there a standard approach for something like this?
ISomething.