Class, constructor and inherance.

holo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 14 20:45:15 PDT 2015


>
> Just some ideas:
>
> interface RequestResult {
> 	...
> }
>
> RequestResult go(string[string] requestParameters)

Basically it is same what you wrote in one of first posts. 
Interface is for declaration of methods which need to be 
implemented in class. How in that case is it possible to return 
RequestResult which is basically xml form as function/s and one 
of it will be go itself? Do you have any link to such solution 
which i can take as example? I was looking for it but didn't find 
such solution.

One idea

interface RequestResult
{
   string doSomethingWithXML(string xmlString);
   RequestResult go();  //or just not put here that go?
}


Class SigV4 : RequestResult
{
   ...

   go()
   {
     string xml;
     ...
     return doSomethingWithXML(xml);
   }

   doSomethingWithXML(string xmlString)
   {
     ...
   }
}

but i still don't see how it could work like that.


More information about the Digitalmars-d-learn mailing list