To say I have two classes:
ClassA{
//properties
public string NAME{set;get;}
public string ID{set;get;}
public int AGE{set;get;}
//Methods
public void DoSomething();
public void MethodA();
private void MethodB(string name);
private void MethodC(string name);
public void MethodD(string name,string id);
public string getSomething(int age);
}
ClassB{
public void Hello(int input);
public void HelloWorld(string input);
}
1) For ClassA(may have many derived classes),what is the best way to create a design interface(GUI) so that I can specify its property value
2) For ClassA, is there a way to create a design interface(GUI) so that I can specify which method to call and specify the sequence/input/output of methods called?
public void DoSomethingWithClassA(ClassA ca ){
ca.MethodA();
// ca.MethodB(ca.NAME);
// ca.MethodB(ca.ID);
ca.MethodD(ca.NAME,getSomthing(ca.AGE));
}
3) If I have an instance of ClassA, named newClassA, an instance of ClassB, named newClassB, is there a way to create a design interface(GUI) so that I can specify that newClassB could invoke newClassA’s method:
ClassA newClassA...
ClassB newClassB...
newClassB.HelloWorld(newClassA.getSomething(newClassA.AGE));
Basically what I need is to have a design interface(GUI) so that user could “visually design” his classes and could specify relation/input/output of method. I feel it’s something like filter graph.
If someone could possible figure out a solution/framework/design pattern/keywords, it would be much appreciated.
(I should highlight that design interface means GUI for user, sorry for that.)
I think you are looking for something like fluent interfaces.
Take a look at this article, it should help you on how to implement this: http://blog.raffaeu.com/archive/2010/06/26/how-to-write-fluent-interface-with-c-and-lambda.aspx
Here’s a quick example on how you can use this:
I updated the example to make the constructor of
Personinternal. It’s not mandatory but if you do so, it will force any user of your code to use the fluent interface to create an instance of aPerson.